Moving... pretty much required in games right? Well the first tutorial I showed you you needed 8 different events. Well after watching a few youtube videos I found one that had tought me how to move with only 1-2 event(s). The step event has finally proved itself to me. This tutorial requires coding, but you could just copy & paste if you aren't fast at typing which I'm not. Alright lets get started.
STEPS (no pun intended)
1.)You need 2 objects, Obj_guy(player. I like to call it obj_guy because it's shorter) and an obj_land.
2.)obj_land = solid
3.)Under obj_guy make a step event. Execute code.
Type this
if place_free(x,y+.5){gravity = 0.5} //gravity
else{gravity = 0} gravity_direction = 270
if vspeed > 10 {vspeed = 10} //limit speed
if keyboard_check(vk_up) && !place_free(x,y+.5) {vspeed -= 10} //move controls
if keyboard_check(vk_left) && place_free(x-5,y){x-=5}
if keyboard_check(vk_right) && place_free(x+5,y){x+=5}
Okay so the first 2 lines,(before "//limit speed") this is setting the gravity. so if there is no object below you in .5 pixels to set the gravity to 0.5(kinda real life gravity). 2nd line: if there is any thing below you in .5 pixels to set the gravity to 0(no gravity) The gravity_direction = 270 part is just telling the gravity to go downwards.
if vspeed > 10 {vspeed = 10} This is just setting a speed falling limit so your character doesn't go like 300,000 mph down a hole and break through the ground (it's possible, trust me).
Okay lets start with going right.
the first part, if keyboard_check(vk_right) this is telling gamemaker to see if the right arrow key is pressed then do the following actions and if not pressed, then stop. In gamemaker, when you want to add or tie something together, you use 2 & signs. the second part, && place_free(x+5,y){x+=5} this part has the place_free command also. This time it asking if there is anything 5 pixels to the right then move right 5 pixels. Also if you didn't know adding the + or - sign next to the = sign makes it relative. It's Pretty close to the opposite direction just change the + signs to minus and of course add vk_left.
The jumping is also close. the first part is the same. the && signs. something that is different is the ! sign. This won't work without the ! sign!
(x,y+.5) {vspeed -= 10} the first part of this is asking if there's anything below you in .5 pixels, if so vspeed -=10(jumping).
Now that was only the 1st event, the second event is collision with obj_land.
1.) execute code:
if vspeed >= 0 && !place_free(x,y+vspeed) {move_contact(270)} vspeed=0
Okay this code is a little confusing, I still don't know 100% of it.
If vspeed >= 0 and if there is a place free under you while jumping then go downwards(270) and vspeed = 0.
Well that's about it, You should compare this moving with my old moving. much less crowded. Hope you learned something and if you did, tell your friends or anyone that plays gamemaker. I also have a sandbox.yoyogames.com account named pop12601. I put up some games I'm working on and some old games I found. Thanks for reading. Bye!
Happy gaming!
Which type of Game maker do you use?
Monday, June 9, 2014
Friday, June 6, 2014
Events,Events,And More Events
Hello!
I'm bored so I wanna write a post. This post: Events!
So I'm assuming this will be a long post so lets start now.
1.) Create
This event is instantly that object appears. close to the room start event.
ex.) hp = 100
2.)Destroy
This event does the actions right before the object is destroyed, so it still exists then after the actions it's destroyed.
ex.) score =+ 2
3.)Alarm
Alarms are used for timing. there is an action needed for this event called " set alarm "(you set the alarm then steps. In gamemaker 30 steps is one second). Basically you could put set alarm 0 for 30 seconds in the create event, then after one second the actions under alarm 0 will happen.
ex.) Timer; get to the end by a certain amount of time.
4.)step
The step event happens constantly. To be more precise, I think it's about 1/30th of a second, i think I read that somewhere. The begin and end step are rarely needed but begin step happen before the normal step and end step happen after the normal step
ex.)make the object look at the mouse
5.)Collision
this event happens whenever this object collides with another object.
ex.) obj_player collides with obj_wall will cause speed = 0
6.)keyboard
this is very similar to the key press event, to be honest, I never found a difference.
ex.)Moving
7.)Mouse
This is probably one of the most useful events. It includes left button pressed, left button, left release same with right, and more.
ex.)shooting to the mouse
8.) other
outside room- when the object goes out of the screen
intersect boundary- the object collides with the boundary of the room
views- boundary's & outside of views
game start- as soon as the game starts
game end- as soon as the game ends
room start & room end- happens when the room starts + ends
no more lives- gamemaker has a built in life system and this happens when lives equal 0
no more health- gamemaker also has a built in health system and this activates when health = 0
animation end- all sprites that have images have animation, and once that animation is done this event activates
end of path- this event works only with objects that have paths and once that path is done, this activates
close button- the close button the X in the corner of the window that you click to end the game
user defined- events when you decide and not gamemaker
9.)draw- this event is used to draw or show sprites,backgrounds, and whatever is under the draw tab
ex.)showing how much health is left
10.)key pressed- this event occurs whenever the button is pressed
ex.)start to move
11.)key release-this event occurs whenever the button is released
ex.)stop moving
12.)triggers- this event is only in standard and i still have lite, so i have no idea what it does. My guess is that it's kinda like an alarm.
Well that's all of 'em. well that took a long time. So I hope you learned something about this post and you can carry you knowledge to someone else. Good luck.
Happy Gaming
I'm bored so I wanna write a post. This post: Events!
So I'm assuming this will be a long post so lets start now.
1.) Create
This event is instantly that object appears. close to the room start event.
ex.) hp = 100
2.)Destroy
This event does the actions right before the object is destroyed, so it still exists then after the actions it's destroyed.
ex.) score =+ 2
3.)Alarm
Alarms are used for timing. there is an action needed for this event called " set alarm "(you set the alarm then steps. In gamemaker 30 steps is one second). Basically you could put set alarm 0 for 30 seconds in the create event, then after one second the actions under alarm 0 will happen.
ex.) Timer; get to the end by a certain amount of time.
4.)step
The step event happens constantly. To be more precise, I think it's about 1/30th of a second, i think I read that somewhere. The begin and end step are rarely needed but begin step happen before the normal step and end step happen after the normal step
ex.)make the object look at the mouse
5.)Collision
this event happens whenever this object collides with another object.
ex.) obj_player collides with obj_wall will cause speed = 0
6.)keyboard
this is very similar to the key press event, to be honest, I never found a difference.
ex.)Moving
7.)Mouse
This is probably one of the most useful events. It includes left button pressed, left button, left release same with right, and more.
ex.)shooting to the mouse
8.) other
outside room- when the object goes out of the screen
intersect boundary- the object collides with the boundary of the room
views- boundary's & outside of views
game start- as soon as the game starts
game end- as soon as the game ends
room start & room end- happens when the room starts + ends
no more lives- gamemaker has a built in life system and this happens when lives equal 0
no more health- gamemaker also has a built in health system and this activates when health = 0
animation end- all sprites that have images have animation, and once that animation is done this event activates
end of path- this event works only with objects that have paths and once that path is done, this activates
close button- the close button the X in the corner of the window that you click to end the game
user defined- events when you decide and not gamemaker
9.)draw- this event is used to draw or show sprites,backgrounds, and whatever is under the draw tab
ex.)showing how much health is left
10.)key pressed- this event occurs whenever the button is pressed
ex.)start to move
11.)key release-this event occurs whenever the button is released
ex.)stop moving
12.)triggers- this event is only in standard and i still have lite, so i have no idea what it does. My guess is that it's kinda like an alarm.
Well that's all of 'em. well that took a long time. So I hope you learned something about this post and you can carry you knowledge to someone else. Good luck.
Happy Gaming
More About Sprites!
'ello fellow gamers!
So I was reading my blog because I was bored and I realized I didn't tell much about sprites in gamemaker.
So hear I am.
1.) The transform button
This button shows at the top of the screen next to edit. The transform button allows you to rotate, flip, skew, shift, and more. They do exactly as they sound.
2.) The images button
Right after the transform button, it allows to cycle in multiple ways, change the value & intensity, "colorize"(change the color) and more cool effects if you have standard version
3.) the animation button
The button located after images, the animation button allows the computer to rotate or shift or colorize automatically, so its easier on you.
4.)Masks
Masks are the space on the object to collide with other objects. ex.) you have a square sprite and you set the mask to be the whole square. this would be perfect because if it collides with a wall, it'll stop as soon it touches the mask(the square in this example). However if you had a square and only made the center the mask, the square will keep going until the center hits the wall.
4A.) masks:Bounding box
after you click "modify mask under your sprite you'll come across a screen that has your sprite and kinda darkened. the darkened part is the mask. there are ways to change this and there a sub heading that says "bounding Box" that has "automatic"(automatically puts the mask in the sprite), "full image"(no matter how big the image is this option will make the mask in full size), and "manual"(you make the mask).
4B.)masks: shape
instead of bounding box, there is another sub heading called "shape". I rarely use this one but I'll need to explain it sometime. So there is 4 options under shape, "precise"( this make the mask perfect), "rectangle"(makes the mask a rectangle), "disk"(disk is another word for circle), and "diamond"( I never found a use for diamond, but it does what it sounds like, makes the mask diamond)
5.)save sprite
This button is found under Load sprite and above edit sprite. What this button does is save your sprite if you made or edited one. ex.) You go to edit sprite and you make an amazing sprite of a top down shooter, you probably don't want to make it again and spend another hour on it. so you can click save sprite and it'll go under the folder of your choice and you can use it whenever.
6.)Origin
the origin of the sprite is the center. the origin comes in handy when you make the sprite rotate and shoot with accuracy.
That's about all I know about sprites. If i learn more I'll edit this post and tell ya fellow gamers more.
Good luck with gamemaker.
Happy gaming!
So I was reading my blog because I was bored and I realized I didn't tell much about sprites in gamemaker.
So hear I am.
1.) The transform button
This button shows at the top of the screen next to edit. The transform button allows you to rotate, flip, skew, shift, and more. They do exactly as they sound.
2.) The images button
Right after the transform button, it allows to cycle in multiple ways, change the value & intensity, "colorize"(change the color) and more cool effects if you have standard version
3.) the animation button
The button located after images, the animation button allows the computer to rotate or shift or colorize automatically, so its easier on you.
4.)Masks
Masks are the space on the object to collide with other objects. ex.) you have a square sprite and you set the mask to be the whole square. this would be perfect because if it collides with a wall, it'll stop as soon it touches the mask(the square in this example). However if you had a square and only made the center the mask, the square will keep going until the center hits the wall.
4A.) masks:Bounding box
after you click "modify mask under your sprite you'll come across a screen that has your sprite and kinda darkened. the darkened part is the mask. there are ways to change this and there a sub heading that says "bounding Box" that has "automatic"(automatically puts the mask in the sprite), "full image"(no matter how big the image is this option will make the mask in full size), and "manual"(you make the mask).
4B.)masks: shape
instead of bounding box, there is another sub heading called "shape". I rarely use this one but I'll need to explain it sometime. So there is 4 options under shape, "precise"( this make the mask perfect), "rectangle"(makes the mask a rectangle), "disk"(disk is another word for circle), and "diamond"( I never found a use for diamond, but it does what it sounds like, makes the mask diamond)
5.)save sprite
This button is found under Load sprite and above edit sprite. What this button does is save your sprite if you made or edited one. ex.) You go to edit sprite and you make an amazing sprite of a top down shooter, you probably don't want to make it again and spend another hour on it. so you can click save sprite and it'll go under the folder of your choice and you can use it whenever.
6.)Origin
the origin of the sprite is the center. the origin comes in handy when you make the sprite rotate and shoot with accuracy.
That's about all I know about sprites. If i learn more I'll edit this post and tell ya fellow gamers more.
Good luck with gamemaker.
Happy gaming!
Saturday, March 15, 2014
How To Jump
Hi gamers! Jumping is almost required in all arcade games right? And gamemaker is great for making arcade games! So i figured I should make a tutorial about jumping.(in steps)
1.)make two sprites the obj_guy & obj_land
2.) under obj_guy choose the create event: Set gravity
gravity : .5
direction : 270
2A.)the last action for this event is a variable: Set variable
variable: jump
value : 0
3.)the second event is "press (jump button)"
test variable:
if var jump is equal to 0
Start of block
set vertical speed to -10
Set var jump to 1
End of block
if var jump is equal to 1
Start of block
exit this event
end of block
should look like that.
4.) now the last event is collision with the obj_land
set vertical speed to 0
set var jump to 0
That's what you need to know about jumping. I'm sure thereare multiple other ways, but this is the easiest i've seen by far.
Hope you enjoyed this post and
Happy Gaming!
1.)make two sprites the obj_guy & obj_land
2.) under obj_guy choose the create event: Set gravity
gravity : .5
direction : 270
2A.)the last action for this event is a variable: Set variable
variable: jump
value : 0
3.)the second event is "press (jump button)"
test variable:
if var jump is equal to 0
Start of block
set vertical speed to -10
Set var jump to 1
End of block
if var jump is equal to 1
Start of block
exit this event
end of block
should look like that.
4.) now the last event is collision with the obj_land
set vertical speed to 0
set var jump to 0
That's what you need to know about jumping. I'm sure thereare multiple other ways, but this is the easiest i've seen by far.
Hope you enjoyed this post and
Happy Gaming!
How To Shoot Toward The Mouse
Hello friendly game maker fellows! I was making a game a bit ago where you use w,a,s,d to move and the mouse to shoot. Then i thought "Hey, I should put a tutorial on how to shoot the mouse." And here I am.
Alright so the first thing you want to do is make 2 sprites, obj_guy & obj_bullet.
Now go to the obj_guy and select the event Global left pressed. (mouse->Global mouse->Global left pressed)
once you've done that go to execute code (under controls tab) Don't stop reading because there is coding it is at most 5 lines.
Type in:
with instance_create(x,y,obj_bullet)
{
speed=20
direction=point_direction(x, y, mouse_x, mouse_y)
}
This code is saying to create instance of obj_bullet with the speed of 20 and the direction is where mouse was clicked.
That's how to shoot toward the mouse.
Another thing you might want in to make your character look at the mouse. this requires coding but only 1 line.
So under obj_guy click the step event.
Then click execute code.
Type:
image_angle = point_direction(x,y,mouse_x,mouse_y);
This is telling gamemaker to make obj_guy follow the direction of the x and y of the mouse.
That's all you need required to make multiple other types of games.
Thanks for reading.
Happy Gaming!
Alright so the first thing you want to do is make 2 sprites, obj_guy & obj_bullet.
Now go to the obj_guy and select the event Global left pressed. (mouse->Global mouse->Global left pressed)
once you've done that go to execute code (under controls tab) Don't stop reading because there is coding it is at most 5 lines.
Type in:
with instance_create(x,y,obj_bullet)
{
speed=20
direction=point_direction(x, y, mouse_x, mouse_y)
}
This code is saying to create instance of obj_bullet with the speed of 20 and the direction is where mouse was clicked.
That's how to shoot toward the mouse.
Another thing you might want in to make your character look at the mouse. this requires coding but only 1 line.
So under obj_guy click the step event.
Then click execute code.
Type:
image_angle = point_direction(x,y,mouse_x,mouse_y);
This is telling gamemaker to make obj_guy follow the direction of the x and y of the mouse.
That's all you need required to make multiple other types of games.
Thanks for reading.
Happy Gaming!
Wednesday, January 29, 2014
How To Make The Screen Follow The Player
Hi gamers! This fast post will show you how to make the screen follow your player. This is very helpful when you make a 2-D side-scroller such as Mario.
Also make sure that under your room settings, you change the width & height or else this will be useless.
So first things first we need a sprite for the player. once you make the sprite, make an object with that sprite. I'll name it obj_player.
Now you have the object, make a room (call it rm_game).
1.) Go to rm_game then views
Under views
2.) Check "Enable the use of views" & "Visible when room starts"
Under views - object following
3.) From the drop down menu (next to <no object>) choose obj_player
4.) fill in...
Hbor: 500
Vbor: 500
Also make sure that under your room settings, you change the width & height or else this will be useless.
Viola! That's it! Congratulations! You are one step closer to making a game such as megaman and mario!
See ya fellow gamers and...
Happy Gaming!
Monday, January 27, 2014
How To Have Bullets
Hi gamers! So You're here about bullets? Tsk, tsk, tsk you're a violent person. Alright well this is the post for you. Just make sure you only shoot in the game.
*I feel like listing the steps in this post*
1.) You need 2 sprites and 2 objects for the player & the bullet. I will use a square sprite and call it obj_guy.

2.) Go to obj_guy's object and select the "create event"
3.) Go to the control tab and right-click Set Variable
4.) fill this in.
Variable: ammo
Value: 10 (this is your amount)
click ok
5.) Now go to the events and click "key press - right"
6.) Go to controls tab click test variable. fill in
Variable: ammo
Value: 0
Operation: equal to
Click ok
7.) Click...
Start of block
exit this event
end of block
ELSE
Set variable (Variable: ammo Value: -1) (RELATIVE)
create moving instance fill in
Object: (your bullet object)
X: 0
Y: 0
Speed: (how fast you're bullet shoots)
Direction: (this depends which direction you will shoot)
NOTE: Gamemaker directions
right: 0
up: 90
left: 180
down: 270
By the end your screen should look like this:
Now I'm assuming you want to pick up ammo somehow so...
1.)make a sprite for your ammo box
2.)make an object. use that sprite.
3.)Now go to obj_guy's window
4.)Use collision with ammo box
5.)Set variable ammo +(however much ammo the box has)(RELATIVE)
6.)destroy the instance(Other)
There you go you violent fellow gamer. See ya!
A few FAQS (well...not really asked, but these are questions I imagine a few of violent gamers asks)
Q: Why can I only shoot once?
A: Make sure you press relative with the shooting
Q: Is there a way I can see the amount of ammo left?
A: Yep! what you need to do is make a <no sprite> object. Make a draw event. go to draw variable.
1.)At the top pick obj_guy
Self
Other
Object: obj_guy <= this one
2.)Type the ammo variable
3.)select the X and Y
4.)pick relative if you want your ammo above your head.
Happy gaming!
*I feel like listing the steps in this post*
1.) You need 2 sprites and 2 objects for the player & the bullet. I will use a square sprite and call it obj_guy.
2.) Go to obj_guy's object and select the "create event"
3.) Go to the control tab and right-click Set Variable
4.) fill this in.
Variable: ammo
Value: 10 (this is your amount)
click ok
5.) Now go to the events and click "key press - right"
6.) Go to controls tab click test variable. fill in
Variable: ammo
Value: 0
Operation: equal to
Click ok
7.) Click...
Start of block
exit this event
end of block
ELSE
Set variable (Variable: ammo Value: -1) (RELATIVE)
create moving instance fill in
Object: (your bullet object)
X: 0
Y: 0
Speed: (how fast you're bullet shoots)
Direction: (this depends which direction you will shoot)
NOTE: Gamemaker directions
right: 0
up: 90
left: 180
down: 270
By the end your screen should look like this:
Now I'm assuming you want to pick up ammo somehow so...
1.)make a sprite for your ammo box
2.)make an object. use that sprite.
3.)Now go to obj_guy's window
4.)Use collision with ammo box
5.)Set variable ammo +(however much ammo the box has)(RELATIVE)
6.)destroy the instance(Other)
There you go you violent fellow gamer. See ya!
A few FAQS (well...not really asked, but these are questions I imagine a few of violent gamers asks)
Q: Why can I only shoot once?
A: Make sure you press relative with the shooting
Q: Is there a way I can see the amount of ammo left?
A: Yep! what you need to do is make a <no sprite> object. Make a draw event. go to draw variable.
1.)At the top pick obj_guy
Object: obj_guy <= this one
2.)Type the ammo variable
3.)select the X and Y
4.)pick relative if you want your ammo above your head.
Happy gaming!
The Magic Of Variables
Hi gamers!
This post will only introduce the meanings and uses of variables.
A variable stores information in few letters for the creator to understand.The variable actions can be found in the control tab with 3 different actions:
Set variable-Starts a variable (mainly used in the create event. ex.ammo)
Test variable-This sees if the variable is allowed for the next action (if ammo is equal to 0-exit this event)
Draw variable-This action draws the value of a certain variable (the ammo left in the gun)
Variables are adequate for game play in most games. The cool thing about variables is that they can be used for ANYTHING.
Some examples of a few useful variables:
Ammo
Lives
Health
MP/magic points
Score
Variables can even be used for jumping.
Later posts will have examples of variables.
See ya fellow creators and happy gaming!
This post will only introduce the meanings and uses of variables.
A variable stores information in few letters for the creator to understand.The variable actions can be found in the control tab with 3 different actions:
Set variable-Starts a variable (mainly used in the create event. ex.ammo)
Test variable-This sees if the variable is allowed for the next action (if ammo is equal to 0-exit this event)
Draw variable-This action draws the value of a certain variable (the ammo left in the gun)
Variables are adequate for game play in most games. The cool thing about variables is that they can be used for ANYTHING.
Some examples of a few useful variables:
Ammo
Lives
Health
MP/magic points
Score
Variables can even be used for jumping.
Later posts will have examples of variables.
See ya fellow creators and happy gaming!
Sunday, January 26, 2014
How To Move
Most good games of gamemaker make your character move somehow. This quick post will tell you how to make your character move.
First what you need is an object. For this post I'll use the name obj_player for my object.
Now go to the obj_player's window.
click add event-key press-A
go to actions - move tab - speed horizontal
Under the key press events
<A> = horizontal speed -4
<D> = horizontal speed 4
Vertical speed
<S> = Vertical speed 4
<W> = Vertical speed -4
MAKE SURE NOT TO PRESS RELATIVE
Now we need to make the player stop when not pressing anything.
For this, we use the event key release.
Under the key release events:
<A & D> = horizontal speed 0
vertical speed
<S & W> = vertical speed 0
That's all you need to make a player move.
Happy Gaming!
First what you need is an object. For this post I'll use the name obj_player for my object.
Now go to the obj_player's window.
click add event-key press-A
go to actions - move tab - speed horizontal
Under the key press events
<A> = horizontal speed -4
<D> = horizontal speed 4
Vertical speed
<S> = Vertical speed 4
<W> = Vertical speed -4
MAKE SURE NOT TO PRESS RELATIVE
Now we need to make the player stop when not pressing anything.
For this, we use the event key release.
Under the key release events:
<A & D> = horizontal speed 0
vertical speed
<S & W> = vertical speed 0
That's all you need to make a player move.
Happy Gaming!
Sprites & Objects
Depending on which gamemaker version you are using, you should go to file and make sure advanced mode is on. This post will show the uses of sprites and objects and why they are needed for gameplay.
Sprites are the image(s) for your objects in the game. To make a sprite you can do it 1 of 3 ways. you could go to resources (at the top next to edit and scripts) and click create sprite. You could right-click sprite on the left toolbar; click create sprite. You could click the green/red pac-man thing in the toolbar and that brings it up. After you have that loaded, click edit sprite.

Once you click it, make a sprite then click the green checkmark to close the editor. Click center (center makes the x and y axis accurate) and click ok.And don't forget to add a name(ex.spr_player).
Objects bring your sprites to life with actions and events. You can create an object with the same ways as a sprite except the green/blue creates an object. When the create object screen comes up, click <no sprite> and select the sprite you made.
Thats the basic of the objects and sprites
Happy Gaming!
Sprites are the image(s) for your objects in the game. To make a sprite you can do it 1 of 3 ways. you could go to resources (at the top next to edit and scripts) and click create sprite. You could right-click sprite on the left toolbar; click create sprite. You could click the green/red pac-man thing in the toolbar and that brings it up. After you have that loaded, click edit sprite.
Once you click it, make a sprite then click the green checkmark to close the editor. Click center (center makes the x and y axis accurate) and click ok.And don't forget to add a name(ex.spr_player).
Objects bring your sprites to life with actions and events. You can create an object with the same ways as a sprite except the green/blue creates an object. When the create object screen comes up, click <no sprite> and select the sprite you made.
Thats the basic of the objects and sprites
Happy Gaming!
Gamemaker Introduction
Gamemaker's a fun program to make games.You can make full platform shooting games start to end without any coding! I'll post a few games that I'm proud of. Gamemaker makes games using sprites, sound, paths, backgrounds, sounds, scripts, shaders, and rooms. The program can make very simple games such as fruit bouncing but it can also make full fps games(which I don't play). So continue if you want to learn something about the epic program.
Link to the program: http://www.yoyogames.com/studio/download
Happy Gaming!
Link to the program: http://www.yoyogames.com/studio/download
Happy Gaming!
Subscribe to:
Comments (Atom)