Making your FIRST GAME #1 - GameMaker Studio 2 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so you just opened game maker studio 2 and you want to make a game as anyone would you would create a new project and then take a look at what you got to work with if this is what your first experience with game maker looked like then this video is for you actually if you clicked on this video then that means you probably need a game maker tutorial anyway so this video is probably for you no matter what i guess anyways game maker studio is a simple easy to use you know what let's just leave it at game maker makes games yep okay so you boot up game maker and make a project and call it a really awesome name in this series i'll show you how to program a simple top-down shooter game thing and don't worry you don't need any game maker experience whatsoever let's begin so in the game you need a player character and you want to make that player do stuff right so to do just that you go over here to this asset browser over here expand that out a little and right click it hover over create and go down to object go over here and call this object obj player cool in game maker an object is basically a thing in the game that does stuff it's a pretty broad description but that's really just what it is if you want to make a player make an object if you want to make a power up make an object if you want to make a flying pig so now we have a player but we haven't told game maker what the player should look like to make an image for the player let's just go over here right click the sprites folder create a sprite a sprite is an image or a series of images for objects and it's not just a soft drink now when you click this edit image button it takes you to an image editor where you can draw your own images for the player keep in mind the player doesn't have to look all that great now he can just be whatever this is for the time being now we have a player object and a player sprite so if we double click our player over here let's come over here and just drag that sprite in also it's pretty important to name your sprites so you can keep them well organized so i'll call this one spr player so now we made our player object right here but if we launch the game by pressing f5 or this button right here uh it will take a little bit to load and then we can get our window so this is the game window and as you can see it is a pretty dark nothingness and we don't want that so to make our player in the game now let's come over to the asset browser again and open up this folder called rooms so game maker has went ahead and created a room for us to use right here so if we double click the room it opens up this room editor the room editor is a place for you to put in objects and images and everything you need to make your level now that we can edit the room let's just drag our player object and put it in the game look at that there he is right there so this looks pretty good now we have a player launch the game again and you'll find that we have this guy right here that's awesome so now we need to make this guy move around when the player presses certain keys i'm thinking i'll use the wasd keys for this because the player would need to use the mouse later close out of that go back to the workspace and now here we go time to actually program something if we double click the player again it'll take us to this window here and there's also this window right next to it called events and this box allows us to add events to the object events are pieces of code that run at certain times for each object i'm going to press add event then step event and then here we have this code window step events run every game frame which is typically 1 60th of every second so over here in this code block we'll get rid of the filler text give ourselves a few lines of code and then start programming so our goal with this code block is to allow the player to move the character if they press the wasd keys so how do we move the player well we need to change these variables called x and y so x is the player's position going horizontally or left to right and y is the player's position going up and down a greater x means more to the right less x means more to the left less y equals more up and greater y means more down so that's slightly different from normal normally you'd think oh wouldn't a positive y make it go upwards well it doesn't it's kind of weird i don't know so we want to change these right based on whether the player presses some keys or not so we're going to do that through some if statements so let's get rid of everything and type a statement called if so if statements look at what's inside these parentheses and if that's true then it runs this code in these curly brackets so i'm going to type some code to make it so our player goes to the right if we're pressing the d key so for instance if keyboard check board d then x plus plus so what this code block does if we are pressing d then we increase the player's x position making us go right so now that we have this simple if statement right here we want to do it for all four directions so what we can do is just copy this code paste it a few times change up the letters and then we want to think if we're pressing a then we want our player to move left so our x should be decreased instead of increased oh by the way this plus plus and minus minus just increases this value by one or in this case decreases this value by one so if we're pressing the a key then x will decrease by one now if we go down here we will we're pressing the s key right so we want our player to move down so let's change this comment to go down to make the player go down we want to increase our y position right here this is up and we want to subtract from the y perfect if we press play wait a few moments for game maker to build the game then we get this window let's see here it is there's the player and if we press the wasd keys and he starts to move around i think i'm going to end it here just because this tutorial is kind of long already so look out for the next tutorial where we add a weapon for the player to shoot see you all then
Info
Channel: DelugeDrop
Views: 2,533
Rating: undefined out of 5
Keywords: gamemaker, game, maker, studio, gms2, gms, tutorial, first game, delugedrop, first
Id: 6_xtUXODv_s
Channel Id: undefined
Length: 8min 39sec (519 seconds)
Published: Thu May 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.