How to Make a Platform Game in
This will require a little bit of experience with Game Maker. Don't do this for your first game.
Steps
-
1Make a simple block sprite for your wall. Also make a sprite for your player. For the wall call it spr_wall and the player spr_player
-
2Make an object called obj_wall and check the solid box.
-
3Make sure you select the wall sprite.
-
4Make an object and call it obj_player.
-
5Make sure you select your player sprite.
-
6For obj_player: go to add event and click Step then Step again. Then go to the control tab, and drag and drop the 'execute code' action.
-
7Now in the code box put in
// simple Platforming code!// if place_free(x,y+1) { gravity = 0.7 gravity_direction = 270 } else { gravity=0 gravity_direction = 270 } //the arrow keys<,>,^ if place_free(x-4,y)and keyboard_check(vk_left){x-=4} if place_free(x+4,y)and keyboard_check(vk_right){x+=4} if !place_free(x,y+1) and keyboard_check(vk_up){vspeed=-10} -
8Just copy and paste.
-
9For obj_player: Go to add event, then Collision, then with obj_wall.
-
10Put in this code (go to the control tab and drag and drop 'execute code':move_contact_solid(direction,12); vspeed=0;
-
11Make a room, call it room_1, make a level design by clicking with the selected object and save the room (click the tick at the top.)
-
12Run the game!
No comments:
Post a Comment