Description
Your task is to design a basic platform game.
Basic requirements
Your game must include:
§ At least three rooms
§ Jumping and collision detection – see over the page for example code
Additional requirements
You may also choose to include:
§ Monsters/obstacles that the player must avoid
§ Life counter
§ Anything else that takes your fancy!
Resources
In addition to the sample code on the next page, you may use any resources from P:>SUBJECTS>COMPUTING>GameMaker or you can look online for free resources.
Assessment
You will need to you will need export and share your game as an executable (.exe) file on the upload folder of the Robotics folder on the R drive.
For an ‘A’ rating, you will need export and share your game as a compressed application zip file on the class blog. Include a screenshot and basic description.
Grade / Performance / CreativityA+ / “How did you do that?!?” / It’s the best!
A / All the basic and additional requirements met in a well-crafted game. / Outstanding and fun to play
B / All the basics plus one of the additional requirements. / Good
C / All the basic requirements have been met / Okay
t / You have something resembling a game / Nothing special
Z / You run away! / Look away!
Sample Code
The following code sample is based on Shaun Spalding’s excellent YouTube video, “Game Maker Studio: Platformer Tutorial” - https://www.youtube.com/watch?v=IysShLIaosk
This section goes in the “Create” Event for the Player object…
//Initialize Variables
grav = 0.2;
hsp = 0;
vsp = 0;
jumpspeed = 7;
movespeed = 4;
This section goes in the “Step” Event for the Player object…
//Get the player's input
key_right = keyboard_check(vk_right);
key_left = -keyboard_check(vk_left);
key_jump = keyboard_check_pressed(vk_space);
//React to inputs and gravity
move = key_left + key_right;
hsp = move * movespeed;
if (vsp < 10) vsp += grav;
if (place_meeting(x,y+1,obj_wall))
{
vsp = key_jump * -jumpspeed
}
// Horizontal collision
if (place_meeting(x+hsp,y,obj_wall))
{
while (!place_meeting(x+sign(hsp),y,obj_wall))
{
x+= sign(hsp);
}
hsp = 0;
}
x += hsp;
// Vertical collision
if (place_meeting(x,y+vsp,obj_wall))
{
while (!place_meeting(x,y+sign(vsp),obj_wall))
{
y+= sign(vsp);
}
vsp = 0;
}
y += vsp;