HTML and CSS Reference
In-Depth Information
Figure 8-7. Geo Blaster Basic in action
Rock Object Prototype
To conserve space, we did not create separate object prototypes for the various display
objects in this game. However, Example 8-13 is a Rock prototype object that can be
used in a game such as Geo Blaster Basic .
Example 8-13. The Rock.js prototype
//*** Rock Object Prototype
function Rock(scale, type) {
//scale
//1 = large
//2 = medium
//3 = small
//these will be used as the divisor for the new size
//50/1 = 50
//50/2 = 25
//50/3 = 16
this.scale = scale;
if (this.scale <1 || this.scale >3){
this.scale=1;
}
 
Search WWH ::




Custom Search