Game Development Reference
In-Depth Information
bonusPlaneSpeed : This sets the speed of the bonus plane.
bonusPlaneSpeed =(bonusPlaneSpeed > 12) ? 12 : 4 + (1*level);
startShots : The number of shots added to the player's cannon when a new level starts.
startShots = 30;
extraScore : The player earns an extra ship for the fleet at the score set here.
extraScore = 10000;
baseEnemyScore : This score is awarded for destroying an enemy plane.
baseEnemyScore = 100;
enemyHitBonus : This bonus score is awarded for hitting multiple planes with the same
flak explosion.
enemyHitBonus = 500;
baseBonusPlaneScore : This score is awarded for destroying a bonus plane.
baseBonusPlaneScore = 500;
maxBonusPlanes : This is the number of bonus planes on the screen at the same time.
maxBonusPlanes = 1;
maxVisibleShips : This sets the number of ships that can be displayed on the screen at
any one time.
maxVisibleShips = 3;
bonusPlaneMaxY : The highest y value at which the bonus plane will enter the screen is
defined here.
bonusPlaneMaxY = 350;
shipYPadding : This determines the number of pixels of padding between the bottom of
the ships and the bottom of the screen.
shipYPadding = 5;
We will define all of these settings variables in the newLevel() function that we will create in the
next chapter. For now, you only need to understand that we will be using these variables to set
the difficulty of the game. They are also a good place for you to start experimenting with the code
and using it to craft your own game.
The more difficulty settings you create, the easier it will be to balance the levels in your game. At
the same time, the more settings you create, the more chances you have to create complexity
and bugs in your code. Your challenge as game developer is to find the right mix for your game.
Search WWH ::




Custom Search