Removing the boxes
In this task, we remove the boxes that we no longer need by using tweens. A box can be removed either when it passes the boundary at the bottom of the game or when the player matches the calculation's result.
Prepare for lift off
We will need two additional files for this task. First, add the circle.png
file to the images
folder. You can find the images from the code bundle.
We also need the
TweenJS library from the CreateJS suite. Download the TweenJS
file from the CreateJS code repository (https://github.com/CreateJS/TweenJS/tags) or locate the file from the code bundle.
Copy the tweenjs-0.5.1.min.js
file and put it into the vendors
folder; the same folder where we put the EaselJS file.
Next, we import the TweenJS library in HTML before we import our game.js
file; refer to the following code:
<script src="vendors/tweenjs-0.5.1.min.js"></script>
Engage thrusters
Let's add the following code for the box-removing logic:
- First, we work on the falling...