Poeman
Banned
- 752
- Posts
- 16
- Years
- Age 30
- Seen Nov 1, 2012
Introduction to Game Maker and GML
by poepoe/poeman
First things first! Open Game Maker and start a new project! I will be using GM8 Registered, I recommend registering if you plan to use GM to make a game because it is only $25(US)
I am assuming you already understand where everything is in the editor, if not GOOGLE.
Create:
1 New object
2 New Sprites
Make 1 sprite a black box, make sure nothing is transparent, title it MASK
Make the other a picture of anything.
Open up the object.
Now here is where I intervene to teach about GML!
GML is the scripting language of Game Maker, if you don't want to use it, find another program. Drag and Drop is not even for beginners, but to help teach the VERY VERY VERY basics of coding to children, if your on PC, I'm assuming your at least 10 and understand some concept of math/programming.
You manipulate games by changing variables(or using a function which is a sort of 1 line command) There are certain variables every object has, you can find them by going to Scripts>Show built in Variables, and scrolling to the local ones.
Manipulating the X, and Y, can manipulate where an object is. If you think of this graph:
0,0 1,0 2,0
0,1 1,1 2,1
0,2 1,2 2,2
That is where the rooms co-ordinates are, if you continued up to make the graph's X be 640, and Y be 480.
In the draw event of the object go and add a new script that says:
draw_sprite(Sprite_name, sub image(set it to image_index, this allows for animation),x,y)
This will draw Sprite_name at the x,y of the object. You need the _ instead of a space because with a space GM won't recognize it.
Add the keyboard left event, make it have the script:
x-=#(# being speed of the object in pixels)
You need the – BEFORE the equals so that it isn't setting the value, for example x=-5 would set the x to -5.
Try setting the other keyboard events for yourself.
Set the mask to the MASK sprite, this sets the collision box so it's always the same, this is important for animated sprites!
If you did it congratulations! You made the simplest movement system ever! Otherwise, try,try,try again!
by poepoe/poeman
First things first! Open Game Maker and start a new project! I will be using GM8 Registered, I recommend registering if you plan to use GM to make a game because it is only $25(US)
I am assuming you already understand where everything is in the editor, if not GOOGLE.
Create:
1 New object
2 New Sprites
Make 1 sprite a black box, make sure nothing is transparent, title it MASK
Make the other a picture of anything.
Open up the object.
Now here is where I intervene to teach about GML!
GML is the scripting language of Game Maker, if you don't want to use it, find another program. Drag and Drop is not even for beginners, but to help teach the VERY VERY VERY basics of coding to children, if your on PC, I'm assuming your at least 10 and understand some concept of math/programming.
You manipulate games by changing variables(or using a function which is a sort of 1 line command) There are certain variables every object has, you can find them by going to Scripts>Show built in Variables, and scrolling to the local ones.
Manipulating the X, and Y, can manipulate where an object is. If you think of this graph:
0,0 1,0 2,0
0,1 1,1 2,1
0,2 1,2 2,2
That is where the rooms co-ordinates are, if you continued up to make the graph's X be 640, and Y be 480.
In the draw event of the object go and add a new script that says:
draw_sprite(Sprite_name, sub image(set it to image_index, this allows for animation),x,y)
This will draw Sprite_name at the x,y of the object. You need the _ instead of a space because with a space GM won't recognize it.
Add the keyboard left event, make it have the script:
x-=#(# being speed of the object in pixels)
You need the – BEFORE the equals so that it isn't setting the value, for example x=-5 would set the x to -5.
Try setting the other keyboard events for yourself.
Set the mask to the MASK sprite, this sets the collision box so it's always the same, this is important for animated sprites!
If you did it congratulations! You made the simplest movement system ever! Otherwise, try,try,try again!
Last edited: