Technical Document: Variable List What On? Variables
Technical Document: Variable List What On? Variables
This game is a short game where the player controls a small human, the game is set in an apocalyptic world. The technical document will contain data set including variables, functions and code which all make this game playable.
Main menu
The main menu is the screen the player first sees, this allows the player to select what they want to do, this includes playing the game or selecting help. Variable list What on? Variables There are no variables set on the start screen.
Function list What on? The PLAY button The HELP button Code list What on? Code There is no code on the main menu. Function Left button, go to play room Left button, go to help room
Help room
The help room is where the player goes if they dont know how to play, I made it so the player hasnt got to go to the help room encase they already know how to play, it might just waste their time. Help bubbles reveal themselves when the player steps near them. Variable list What on? Player Variables Image_xscale=1 Onfloor=true Hspeed=0 Sprite_index=player_idle Jump=0 Onladder=false Vpspeed=0 Fall=0 Gravity=0 Hurtnumber=0 Hurtable=true Image_alpha=0
Function Create Set variables jump, hurtable, lives, onladder, gravity, fall, onfloor Step If lives is less than 0, restart room Press <UP> If jump is 0 Set vertical speed to -21 Set jump to 1 Set gravity to 2 On collision with player Image_alpha+=.1
Code
//Player movement, left button if(keyboard_check_direct(vk_left)){ x-=6; image_xscale=-1; //If the player is on floor, display player run if(onfloor==true){ sprite_index = player_run;
} //Player movement, right button }else if(keyboard_check_direct(vk_right)){ x+=6; image_xscale=1; //If the player is on floor, display player run if(onfloor==true){ sprite_index = player_run; } }else if(!keyboard_check_direct(vk_right) && ! keyboard_check_direct(vk_left) && onfloor==true){ hspeed=0; sprite_index = player_idle; }else if(onfloor==false){ sprite_index = player_jump; } //on ladder if place_meeting(x,y-1,ladder2){ onladder=true; jump=1; gravity=0; vspeed=0; fall=0; } else { onladder=false; } //ladder = true if (onladder==true){ if(keyboard_check_direct(vk_up)){ y-=5; } if(keyboard_check_direct(vk_down)){ y+=5; } } //if player isn't on the floor or the ladder y+=fall; if place_meeting(x,y+1,mainblock)==false && onladder==false{ onfloor=false; if(fall<=10){ fall+=1; } } if place_meeting(x,y+2,mainblock){ onfloor=true; jump=0; fall=0; vspeed=0; gravity=0; } //pushing out of floor //right wall if place_meeting(x+5,y-5,mainblock) or place_meeting(x+5,y-1,mainblock) or place_meeting(x+5,y-10,mainblock){ x-=6; } //left wall if place_meeting(x-6,y-5,mainblock) or place_meeting(x6,y-1,mainblock) or place_meeting(x-6,y-10,mainblock){ x+=6; } //if roof hit if place_meeting(x,y-15,mainblock){ vspeed=-5; y+=5; } //if floor hit if place_meeting(x,y-1,mainblock) || place_meeting(x+1,y-1,mainblock) || place_meeting(x1,y-1,mainblock){ y-=7; gravity=0; vspeed=0; }
Sign post
image_alpha+=.1
Level 1 Level one is the first main level in the game, it isnt the first room the player controls the character though. In this room you only need to avoid the enemies and make it to the end of the level. Variable list What on? Level 1 (Global) Player Variables Lives=3 Image_xscale=1 Onfloor=true Hspeed=0 Sprite_index=player_idle Jump=0 Onladder=false Vpspeed=0 Fall=0 Gravity=0 Hurtnumber=0 Hurtable=true edirection=1
Controller Enemies
Functions Create set variables jump, hurtable, lives, onladder, gravity, fall, onfloor Step If lives is less than 0, restart room Press <UP> If jump is 0 Set vertical speed to -21 Set jump to 1 Set gravity to 2 On collision with spikes Lifes 1 Hurtable = false On collision with enemy Lifes 1 Hurtable = false On collision with door Next room Draw Draw life images Create
Set variables direction Step Code Code list What on? Player Enemy Code The same code for the player above
if(edirection==0){ x+=3; image_xscale=1; } if(edirection==1){ x-=3; image_xscale=-1; } //direction change //cliff - no wall, change direction left if place_meeting(x,y+2,mainblock) && !place_meeting(x20,y+2,mainblock){ edirection=0; } //wall hit, change direction left if place_meeting(x-10,y-2,mainblock){ edirection=0; } //cliff / no wall, change direction right if place_meeting(x,y+2,mainblock) && ! place_meeting(x+20,y+2,mainblock){ edirection=1; } //wall hit, change direction right if place_meeting(x+10,y-2,mainblock){ edirection=1; }
Level 2
Room 2 is the next level in the game, the player needs to avoid all enemies and other hazards and reach the end of the room. Variable list What on? Level 2 (Global) Player Variables Lives=3 Image_xscale=1 Onfloor=true Hspeed=0 Sprite_index=player_idle Jump=0 Onladder=false Vpspeed=0 Fall=0 Gravity=0 Hurtnumber=0 Hurtable=true edirection=1
Controller Enemies
Functions Create set variables jump, hurtable, lives, onladder, gravity, fall, onfloor Step If lives is less than 0, restart room Press <UP> If jump is 0 Set vertical speed to -21 Set jump to 1 Set gravity to 2 On collision with spikes Lifes 1 Hurtable = false On collision with enemy Lifes 1 Hurtable = false On collision with door Next room Draw Draw life images Create Set variables direction Step Code
Code list What on? Player Enemy Code The same code for the player above The same code for the enemy above
Level 3
Room 3 is the last room in the game, after the player avoids all hazards and reaches the end of the level, they are directed to the end screen. Variable list What on? Level 3 (Global) Player Variable Lives=3 Image_xscale=1 Onfloor=true Hspeed=0 Sprite_index=player_idle Jump=0 Onladder=false Vpspeed=0 Fall=0 Gravity=0 Hurtnumber=0 Hurtable=true edirection=1
Controller Enemies
Functions Create set variables jump, hurtable, lives, onladder, gravity, fall, onfloor Step If lives is less than 0, restart room Press <UP> If jump is 0 Set vertical speed to -21 Set jump to 1 Set gravity to 2 On collision with spikes Lifes 1 Hurtable = false On collision with enemy Lifes 1 Hurtable = false On collision with door Next room Draw Draw life images Create Set variables direction Step Code
Code list What on? Player Enemy Code The same code for the player above The same code for the enemy above
End room
The end room is the very last room in the game, when the player gets to this room their only option is returning to the start screen.
Variable list What on? Variable There are no variables set on the end screen
Function list What on? The RETURN button Code list What on? Code There is no code on the end level. Function Left button, go to start room