HTML and CSS Reference
In-Depth Information
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 botom of the game or when the player
matches the calculaion's result.
Prepare for lift off
We will need two addiional iles 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:
1. First, we work on the falling boundary because it is easier. Define where the y
posiion of the boundary is in the seing object:
game.setting = {
boundaryY: 320,
// existing settings go here.
}
 
Search WWH ::




Custom Search