Game Development Reference
In-Depth Information
package com.efg.games.driveshesaid
{
/**
* ...
* @author Jeff Fulton
*/
public class Level1 extends Level {
public function Level1() {
backGroundTile = 21;
percentNeeded = .50;
playerStartFacing = 0;
timerStartSeconds = 60;
heartScore = 10;
clockAdd = 10;
wallAdjust = .3;
skullAdjust = .20;
wallDriveColor = 0x00000000;
map = [
[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
,6,6,6,6,6,6,6,6],
[6,13,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,
14,6,6,6,6,6,6,6,6,6,13,21,21,21,21,21,21,21,21,14,6,6,6],
[6,0,21,21,21,21,21,21,21,21,21,21,21,21,21,21,3,21,21,21,21,21,21,21,21,21,21,21,
14,6,6,6,6,6,6,6,13,21,21,21,21,21,21,21,21,3,21,14,6,6],
[6,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,3,21,21,21,
21,14,6,6,6,6,6,13,21,21,21,21,21,21,21,21,21,21,21,21,14,6],
[6,11,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,
21,21,21,14,6,6,6,13,21,21,21,3,21,21,21,21,21,21,21,21,21,21,6],
]
...;
}
}
}
The important thing to note is that if when you create your own levels, they must you must match
the structure of this class, especially the level-specific variables at the top of the class. Here is a
rundown of how we will make use of each:
backGroundTile : This is the tile on the tile sheet that will be used to create the
background behind all of our transparent tiles.
percentNeeded : This is the percentage of total hearts that needed to be collected on
the level.
playerStartFacing : This is the angle (0 is facing to the right) for the starting position of
the player car.
timerStartSeconds : This is the number of seconds on the timer when the level starts.
heartScore: This variable holds the score the player receives for collecting a heart.
clockAdd : This one holds the number of seconds added to the level timer for collecting a
clock.
Search WWH ::




Custom Search