Game Development Reference
In-Depth Information
if (checkTile(MOVE_UP, player )) {
if (player.currentDirection == MOVE_UP || player.currentDirection
== MOVE_DOWN || player.currentDirection == MOVE_STOP ) {
switchMovement(MOVE_UP, player );
playSound = true;
}else if (checkCenterTile( player)) {
switchMovement(MOVE_UP, player );
playSound = true;
}
}else{
//trace("can't move up");
}
}
if (keyPressList[40] && player.inTunnel == false) {
if (checkTile(MOVE_DOWN, player )) {
if (player.currentDirection == MOVE_DOWN || player.currentDirection
== MOVE_UP || player.currentDirection == MOVE_STOP) {
switchMovement(MOVE_DOWN, player );
playSound = true;
}else if (checkCenterTile(player)) {
switchMovement(MOVE_DOWN, player );
playSound = true;
}
}else {
//trace("can't move down");
}
}
if (keyPressList[39] && player.inTunnel==false) {
if (checkTile(MOVE_RIGHT, player )) {
if (player.currentDirection == MOVE_RIGHT || player.currentDirection
== MOVE_LEFT || player.currentDirection == MOVE_STOP) {
switchMovement(MOVE_RIGHT, player );
playSound = true;
}else if (checkCenterTile( player)) {
switchMovement(MOVE_RIGHT, player );
playSound = true;
}
}else {
//trace("can't move right");
}
}
Search WWH ::




Custom Search