|
I'll show you here how to make a maze game using scripts. You should learn the first popple_waffles tut about the game maker or the own game maker help.
First, create a object called obj_block (make a sprite to it) and check the "solid".
Then, create a object called obj_ball (make a sprite for it). IT SHOULD NEVER BE SOLID!!!
In the step event, put a piece of code. Write this (I will explain):
| CODE | if keyboard_check(vk_up) if place_free(x,y-4) y-=4; if keyboard_check(vk_down) if place_free(x,y+4) y+=4; if keyboard_check(vk_right) if place_free(x+4,y) x+=4; if keyboard_check(vk_left) place_free(x-4,y) x-=4; |
Allright here? The X is the horizontal position of the player. The Y is the vertical position of the player. (all in pixels)
| CODE | | if keyboard_check(vk_up) if place_free(x,y-4) y-=4; |
If the player presses up and a place is free above our player, he will move up.
| CODE | | if keyboard_check(vk_down) if place_free(x,y+4) y+=4; |
If the player presses down and a place is below the player, he will move down.
The same thing happens with the another lines of code.
Then make a room and make your level!!!
I hope you understood this. If not, feel free to reply here.
--------------------
This is a sig.
|