[face=Sans-Serif][size=14]
UPDATES:
1-) Edited the whole thread and fixed bugs and added 2 new chapters.
2-) Added a new chapter and improved some of spelling mistakes.
3-) Finished the guide and made the thread look nicer.
Here we go...
Chapter one : What do I use to make a game? And what would I start with?
What I have always loved and have stuck with since the early versions is a program created by mark overmars called Game Maker. The name explains it. Its a game maker. This is what we will be using. If I am right I remember I-Conica posting a Download for gamemaker6. in the downloads section. So if you dont have it go there now and download because the tutorial will grow off that.
We will start by making a top down character. Not anything special now we can edit this later. For now create a sprite (right click sprites and click add sprite) Click edit sprite and double click the square in the dark shade of green. Draw a black circle and fill it with grey (the game maker 6 editor is just like paint) then to the left of the filled circle do a red dot facing east (this is for later use so we know where were facing)
Now youve done that click the green tick in the top right of the window. Then do this again for the next window. Call your sprite player_spr (the _spr is a abbreviation of sprite and well need this so we dont get mixed up in what is what.) Now we have our basic sprite (or player) Its rather boring now but well turn it into something glamorous later. Now were going to turn it into an object. Click the top right tick and thats it done with the sprite. Move down the folders and you will see one entitled "objects" right click and click add object. Call the object player_obj (_obj being..oh you get it lol) this is where all the magic happens and it makes the game come to life. We are going to add some basic coding here (WAIT! Dont run off now! coding isn't that hard...its only GML) Click add event and for the Keyboard event choose the Up key. Now to the left there is a number of libraries look at them all and look through each one and what they do. You should do this because it familiarizes you at the beginning of what does what.
Now once you've looked through them all add a script (NOT EXECUTE SCRIPT!!!) and were going to put this code in:
Explanation:
This code indicates if we press up we move forward to what ever direction were facing at the minimum speed of 2. If the speed is more than 2 the speed is minimized to 0 then 0.4 speed gets added every step until it reaches 2. Now we have finished with the code and the event. Lets add a new event. This will be the create event.
Add this code:
Friction is there so we dont go too fast. Test the game (the green play button) with it and without it. See the difference.
Now lets make it so we CAN turn. Test the game up to now. We need to turn lol. So go to your player object again and add an event for the keyboard--->left key for this we just put the following code:
Now to make your character actually spin make sure you have your player_spr's origin centered then go to its object. add event. Step event then end step event. Add the transform the sprite action. Set the values as follows:
xscale = 1
yscale = 1
angle = direction
no mirroring
Now test your game. You can spin! nice work if its working so far!
Once youve done that note that you can play around with the amount of speed that you turn so you can get the effect you want.
Chapter two - Adding walls and making our player stop when it touches it.
Now lets add walls. Walls are not as simple as you think. its not a matter of adding one object nd adding a collision event to out player then making it stop. Nope there are 3 objects involved...
OBJECT 1 - "obj_wall_basic" this will be the parent of our two walls so we dont need to make each one of our walls a collision event we only need one.
Create obj_wall_basic with no sprite and make it solid and visible then exit.
OBJECT 2 - "obj_wall_hor" This is our horizontal wall. We will need to draw a 32x32 sprite of a horizontal wall...do this now. Make the obj_wall_hor and make the sprite you just drew as the sprite of the object. Now make it visible and solid and make its parent out obj_wall_basic.
OBJECT 3 - "obj_wall_vert" Do the same as obj_wall_hor instructions but make the 32x32 sprite a vertical wall.
Now thats it. just one more thing to do for our wall section. Go into our player_obj and do a collision event for the obj_wall_basic. Now for the action add this code:
Now build your level. Add your player and test the game out! Then Improe the look of your walls and player then continue onto chapter 3.
Chapter three - Adding some weapons
Now we have done making our walls and player so lets start making this interesting. Lets add a simple gun. Copy and paste the sprite of your player and call it spr_player_gun and just modify the sprite to your player holding a gun. Now create a bullet spite. Make it 16x16 and centre its origin. Now make an oject called bullet_obj and set the sprite for the object the bullet you just drew. then add an event > other > outside room then add the action destroy then set it to self then ok. This makes it destroy itself when its outside of the games boundary (window) Now goto your player_obj.
We chose left click for our shooting method. If you wish to follow use that method too. Add an event for player_obj make it mouse > global > global left click this makes it so that we dont have to left click ON the sprite to make it shoot. We can left click anywhere. now for the action add this code:
Instance create = create an object
player_obj.x = the x co-ordinates of your player
player_obj.y = the y co-ordinates of your player
bullet_obj = the bullet object that were going to create
Now go back to your bullet_obj. Add the step event then step. Then for the action add this code:
Now go back to your spr_player_gun and place the origin at the gun point. Now go back to the global left click on the player_obj and before you did the code insert sprite change and change the sprite into the spr_player_gun and leave the rest of the values the same.
Now add a new event. Mouse > global mouse left button > left button release then for the action add the sprite change back into its regular standing position. Now test the game out see what you have done.
All done. Onto chapter 4
[face=Arial]Chapter 4 - Adding enemies with HP[/face]
Lets begin. Adding enemies is always hard for beginners. It would help with gamemaker if they had simple D&D actions for it but they don't. So Im going to explain now.
were gonna add an enemy with a range of sight so that if you get close to it it will see you and attack. We will use simple code with this and youll find making AI is easy.
Draw your simple enemy call it spr_enemy. Make it same size and width of your player. And add an object obj_monster. Add an event step->step and for the action add this code:
Now add the create event and add this code:
collision->bullet_obj
then for the action add this code
moving onto chapter 5 the final chapter, we will add views (very effective) and a background for our game.
[face=Arial]Chapter 5 - Adding views and tiles/background[/face]
This is the final chapter and it will be showing you how to add views that follow the player (not revealing the whole room) and tiles that you can use to make floors and stuff.
Now lets start with views. Its really simple but some new people are really scared of trying it out. Ill explain it now for you. Go into your level and click the views tab. Click enable the use of views and visible when the room starts now make the object following your obj_player and make the hbor 4000 and the vbor 100 now make the height 320 and the width 320. Now test the game. We have a view that follows our player!
Now lets continue onto tiles and flooring...
We will be making our own tile sheet. But you can get rippped ones for a certain game or you casn ask for some on forums. Well be making 4. Some different floors for different rooms. Ok so now make a 32x32 sprite and cover it in black and make it non transparent. Now copy it using the clipboard icon in the image editor section And make a new background and call it floorstiles_bg and make it 640x640 in scale. Now double click it in the image editor and paste the sprite you drew. Move it to the top corner. Thats how big your first floor is gonna be. Edit it and make it look like some topdown grass. Now paste again and put it next to the one you just did and edit it and turn it into flowers/moregrass ect do this as many times as you want but make sure its next to eachother.
Now goto your room and goto the tiles panel. Make the tiles size 32x32 and select the grass and fill your room ith it (HOLD SHIFT AND DRAG) and theres your grass. Modify it and add in some more of your tiles. We added some flowers and stuff. Once your done youve set the scene! Improve your character more and more and the walls. Edit the grass and stuff make it look better. Continue onto the Extended TDS game making guide for more info and more stuff to make. Hope you like what turned out. Reps to me.
Cloud
The TOP DOWN SHOOTER *COMPLETE* GUIDE!
[/size][/color][/b][/u][/face]Hello geekimo.comcommunity. Cloud here. I just thought Some people would be thinking after playing some games, Id like to make games. But the ideas passed on with the haunting of: "Oh it can't be done Id need a team for this", "what would I use?! everything out here costs!" and the list goes on. I have the solution! This is the guide to create and execute your own homebrew games for the PC! (for newbies)
UPDATES:
1-) Edited the whole thread and fixed bugs and added 2 new chapters.
2-) Added a new chapter and improved some of spelling mistakes.
3-) Finished the guide and made the thread look nicer.
Here we go...
Chapter one : What do I use to make a game? And what would I start with?
What I have always loved and have stuck with since the early versions is a program created by mark overmars called Game Maker. The name explains it. Its a game maker. This is what we will be using. If I am right I remember I-Conica posting a Download for gamemaker6. in the downloads section. So if you dont have it go there now and download because the tutorial will grow off that.
We will start by making a top down character. Not anything special now we can edit this later. For now create a sprite (right click sprites and click add sprite) Click edit sprite and double click the square in the dark shade of green. Draw a black circle and fill it with grey (the game maker 6 editor is just like paint) then to the left of the filled circle do a red dot facing east (this is for later use so we know where were facing)
Now youve done that click the green tick in the top right of the window. Then do this again for the next window. Call your sprite player_spr (the _spr is a abbreviation of sprite and well need this so we dont get mixed up in what is what.) Now we have our basic sprite (or player) Its rather boring now but well turn it into something glamorous later. Now were going to turn it into an object. Click the top right tick and thats it done with the sprite. Move down the folders and you will see one entitled "objects" right click and click add object. Call the object player_obj (_obj being..oh you get it lol) this is where all the magic happens and it makes the game come to life. We are going to add some basic coding here (WAIT! Dont run off now! coding isn't that hard...its only GML) Click add event and for the Keyboard event choose the Up key. Now to the left there is a number of libraries look at them all and look through each one and what they do. You should do this because it familiarizes you at the beginning of what does what.
Now once you've looked through them all add a script (NOT EXECUTE SCRIPT!!!) and were going to put this code in:
Code: [Select]
{
if (speed < 2) speed = min(2,speed+0.4);
} Explanation:
This code indicates if we press up we move forward to what ever direction were facing at the minimum speed of 2. If the speed is more than 2 the speed is minimized to 0 then 0.4 speed gets added every step until it reaches 2. Now we have finished with the code and the event. Lets add a new event. This will be the create event.
Add this code:
Code: [Select]
{
friction = 0.2
}Explanation:Friction is there so we dont go too fast. Test the game (the green play button) with it and without it. See the difference.
Now lets make it so we CAN turn. Test the game up to now. We need to turn lol. So go to your player object again and add an event for the keyboard--->left key for this we just put the following code:
Code: [Select]
{
direction += 3;
}It makes us turn. Always remember that plus is left and minus is right. its a key code that you need to know. Ill let you do the left keyboard event for yourself. You know what to do.Now to make your character actually spin make sure you have your player_spr's origin centered then go to its object. add event. Step event then end step event. Add the transform the sprite action. Set the values as follows:
xscale = 1
yscale = 1
angle = direction
no mirroring
Now test your game. You can spin! nice work if its working so far!
Once youve done that note that you can play around with the amount of speed that you turn so you can get the effect you want.
Chapter two - Adding walls and making our player stop when it touches it.
Now lets add walls. Walls are not as simple as you think. its not a matter of adding one object nd adding a collision event to out player then making it stop. Nope there are 3 objects involved...
OBJECT 1 - "obj_wall_basic" this will be the parent of our two walls so we dont need to make each one of our walls a collision event we only need one.
Create obj_wall_basic with no sprite and make it solid and visible then exit.
OBJECT 2 - "obj_wall_hor" This is our horizontal wall. We will need to draw a 32x32 sprite of a horizontal wall...do this now. Make the obj_wall_hor and make the sprite you just drew as the sprite of the object. Now make it visible and solid and make its parent out obj_wall_basic.
OBJECT 3 - "obj_wall_vert" Do the same as obj_wall_hor instructions but make the 32x32 sprite a vertical wall.
Now thats it. just one more thing to do for our wall section. Go into our player_obj and do a collision event for the obj_wall_basic. Now for the action add this code:
Code: [Select]
{
speed = 0;
}Sets the speed to 0. or makes it stop.Now build your level. Add your player and test the game out! Then Improe the look of your walls and player then continue onto chapter 3.
Chapter three - Adding some weapons
Now we have done making our walls and player so lets start making this interesting. Lets add a simple gun. Copy and paste the sprite of your player and call it spr_player_gun and just modify the sprite to your player holding a gun. Now create a bullet spite. Make it 16x16 and centre its origin. Now make an oject called bullet_obj and set the sprite for the object the bullet you just drew. then add an event > other > outside room then add the action destroy then set it to self then ok. This makes it destroy itself when its outside of the games boundary (window) Now goto your player_obj.
We chose left click for our shooting method. If you wish to follow use that method too. Add an event for player_obj make it mouse > global > global left click this makes it so that we dont have to left click ON the sprite to make it shoot. We can left click anywhere. now for the action add this code:
Code: [Select]
{
instance_create(player_obj.x,player_obj.y,bullet_obj)
}Explanation:Instance create = create an object
player_obj.x = the x co-ordinates of your player
player_obj.y = the y co-ordinates of your player
bullet_obj = the bullet object that were going to create
Now go back to your bullet_obj. Add the step event then step. Then for the action add this code:
Code: [Select]
{
move_towards_point(mouse_x,mouse_y,3)
}will make the bullet travel to mouse point. when we left click of course.Now go back to your spr_player_gun and place the origin at the gun point. Now go back to the global left click on the player_obj and before you did the code insert sprite change and change the sprite into the spr_player_gun and leave the rest of the values the same.
Now add a new event. Mouse > global mouse left button > left button release then for the action add the sprite change back into its regular standing position. Now test the game out see what you have done.

All done. Onto chapter 4
[face=Arial]Chapter 4 - Adding enemies with HP[/face]
Lets begin. Adding enemies is always hard for beginners. It would help with gamemaker if they had simple D&D actions for it but they don't. So Im going to explain now.
were gonna add an enemy with a range of sight so that if you get close to it it will see you and attack. We will use simple code with this and youll find making AI is easy.
Draw your simple enemy call it spr_enemy. Make it same size and width of your player. And add an object obj_monster. Add an event step->step and for the action add this code:
Code: [Select]
if distance_to_object(GUY) < 70
{
move_towards_point(obj_player.x,obj_player.y,5)
}it means that if the player is 70 steps or less away from the monster. It will start following the player. But if the player gets away from 70 steps of it it will stop following.Now add the create event and add this code:
Code: [Select]
enemyhp = 5this sets the variable enemyhp do not make it say global.enemyhp or it will refer to every enemy in the game. now in the step even add this next code:Code: [Select]
if enemyhp = 0
{
instance_destroy()
}
this means if our enemys hp reaches 0 it will destroy itself. We will modify this code later to make it look nicer. Now we need to add if a bullet collides with our enemy it looses 1 hp of its hp limit. So make this event in the obj_enemy object.collision->bullet_obj
then for the action add this code
Code: [Select]
enemyhp -= 1;that will take 1 hp off its 5 hp if its hit with a bullet. Now goto the bullet_obj and add the collision->enemy_obj then action instance destroy and self. this makes the bullet destroy itself when it touches the enemy. But in the enemy object it deals damage itself. now add a few enemies to your game and test out the effects. Like em?moving onto chapter 5 the final chapter, we will add views (very effective) and a background for our game.
[face=Arial]Chapter 5 - Adding views and tiles/background[/face]
This is the final chapter and it will be showing you how to add views that follow the player (not revealing the whole room) and tiles that you can use to make floors and stuff.
Now lets start with views. Its really simple but some new people are really scared of trying it out. Ill explain it now for you. Go into your level and click the views tab. Click enable the use of views and visible when the room starts now make the object following your obj_player and make the hbor 4000 and the vbor 100 now make the height 320 and the width 320. Now test the game. We have a view that follows our player!
Now lets continue onto tiles and flooring...
We will be making our own tile sheet. But you can get rippped ones for a certain game or you casn ask for some on forums. Well be making 4. Some different floors for different rooms. Ok so now make a 32x32 sprite and cover it in black and make it non transparent. Now copy it using the clipboard icon in the image editor section And make a new background and call it floorstiles_bg and make it 640x640 in scale. Now double click it in the image editor and paste the sprite you drew. Move it to the top corner. Thats how big your first floor is gonna be. Edit it and make it look like some topdown grass. Now paste again and put it next to the one you just did and edit it and turn it into flowers/moregrass ect do this as many times as you want but make sure its next to eachother.
Now goto your room and goto the tiles panel. Make the tiles size 32x32 and select the grass and fill your room ith it (HOLD SHIFT AND DRAG) and theres your grass. Modify it and add in some more of your tiles. We added some flowers and stuff. Once your done youve set the scene! Improve your character more and more and the walls. Edit the grass and stuff make it look better. Continue onto the Extended TDS game making guide for more info and more stuff to make. Hope you like what turned out. Reps to me.

Cloud
NEXT PART...
[/url]

Logged


