Thank you for visiting Blazing Games

This map is out of date

The map is simply a basic tile map. This is essentially just a grid of tiles. The “magic” of this game comes from the ever-changing tiles. There are four types of tiles in the game.

public static const ROCK_RISEN:int = 0;
public static const ROCK_SINKING:int = 1;
public static const ROCK_SUNK:int = 2;
public static const ROCK_SUBMERGED:int = 3;

When the player makes a move, the tile type shifts to the next one in the loop.

public function nextRockState():void
{
++_rockState;
if (_rockState > ROCK_SUBMERGED)
_rockState = ROCK_RISEN;
gotoAndPlay(FRAME_NAMES[_rockState]);
}

The player navigation is done by having four buttons around the player. Clicking on a button moves the player in the appropriate direction at which point all the tiles are shifted and we check to see if the player is standing on lava.

public function update()
{
_player_movie.x = _playerX * 32;
_player_movie.y = _playerY * 32;
_player_movie.setAllowableDirections(
_playerY > 0, _playerX < 19, _playerY < 14, _playerX > 0);
for (var cntr:int = 0; cntr < _map.length; ++cntr)
_map[cntr].nextRockState();
_bsod_text.text = BSOD_QUOTES[Math.floor(Math.random() * BSOD_QUOTES.length)];

var evt:Event;
if (_playerY == 0) {
evt = new Event(WIN_EVENT);
this.dispatchEvent(evt);
} else if ((_playerX == 19) && (_playerY == 14)) {
evt = new Event(LOSE_EVENT);
this.dispatchEvent(evt);
} else if (_map[_playerY*20+_playerX].getRockState() != 1) {
evt = new Event(LOSE_EVENT);
this.dispatchEvent(evt);
}
}

That is really all there is to creating this game from a coding perspective.

Previous page
Chapter 41 Page 4

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2012 Blazing Games Inc. All Rights Reserved