How To Create Your FIRST GAME! - Game Maker Studios Beginner Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Will someone’s first game be of the same kaliber as Hollow Knight?

👍︎︎ 1 👤︎︎ u/Curtmister25 📅︎︎ Jul 15 2020 🗫︎ replies
Captions
so here you wanna make a video game we're gonna be taking the next 50 minutes to making one and at the end of it you guys will have this as the end result it doesn't look like a lot but we're going over a lot of the concepts that you need to learn to understand how to code so that you can manipulate this basic project and start to really make it feel like your own so in today's video we're going to be doing something a little bit different i am just going to be making a game with you guys um you know we're not going to be creating anything crazy not going to be anything revolutionary but we're going to create a project in game maker studios 2 and we're going to try to create something that you can potentially show your friends and get feedback from them uh you can build on this but we're going to keep it simple so when you open up game maker studios 2 you're going to start a new project and i would definitely recommend using gamemaker language just because you can use drag and drop but you're not going to learn any of the coding side of things and i think it's very important because game making can kind of help you to maybe start learning coding and potentially make life easier in the future if you're trying to get a job in something like coding or go to school for coding so anyway we start up a project and you're gonna notice that you have uh these tabs on the side so the main things that we're gonna be using today is sprites which is just for any kind of visual representation so for our character sprites um you know objects anything like that um grass whatever scripts we probably won't be using today but scripts are very important it's just an easier way to clean up your code and have code in a specific place objects we're going to be talking about in a sec but let's just start with the sprites so we're going to create a sprite so we're just going to do s player i usually like to name things um i like to keep names consistent so let's just go over into here and just create a small object i like to use 16 by 16 or 32 by 32 sized canvases and we're just going to make a blank sprite we can make our character a little green guy here if you hit g you can open up the paintbot bucket bucket oh my god i don't know how to speak um and then i usually like to center all my sprites just to make sure that if we do any kind of flipping on the x and y scale then we can still keep it consistent so we're going to create a player we're going to create an enemy and we're probably going to create some kind of death wall type scenario so let's just create another thing and we're just going to go back into here and create a little thing like this hit f and then you can use a paint bucket just to fill keeping things very very simple for now and then let's create this wall and it's not going to act technically as a wall i want it to be some kind of obstacle that will kill you if you run into it so let's just keep these you know maybe black maybe black is good actually you know we'll do a different aesthetic we'll go for a nice we'll go for a nice go for black actually all right let's go for black and then the last object that we want to create is going to be our we're going to create a gun that is going to move towards where you're shooting um and then we're going to create a bullet so we're going to create this gun sprite we're just going to create basically like a top down shooter um so yeah maybe maybe an 8x8 canvas here and this isn't really going to look like a gun i apologize but you guys can spend some time on the pixel art i actually made a video on on creating pixel art so if you want to check that out you can but here's our gun here's our nice little gun and we're going to show that this is the front of our gun look at that beautiful there we go so now that we have all of our sprites set up once we get this 4x4 little circle here then that might be a little too small but we'll go with it we'll create a little thing there we go and just like that we got all of our sprites now let me just center all these sprites to make sure that they're that they're good i think i think for this sprite we want to keep it more to the back in the middle so let's do like a bottom middle left sorry uh the walls we can keep it doesn't really matter i think that keeping any kind of uh terrain object is good to keep it at the top left because it keeps it consistent when you open up the room which we'll also go over in a sec but there we go um so now we're going to create an object and our the first object we're going to make is our player object so we're going to create a player object and if you go into here if you click on this it's going to allow you to create a sprite for this object you can change it at any time but yeah so right click add an event and let's create a create event and what a create event is going to do is basically you can set up anything you want in the in the character object and it'll apply it once and it'll never do it again it'll do it when it creates the object and it will never do it again so this is where you want to set up all of your variables and all that kind of stuff so we're going to keep it simple and we're just going to say speed we're just going to set up a speed variable and we're going to have speed equal to 1 for now you can change these things around maybe we'll do 1.5 just because i find that to be a little bit better and then we have a vsp and a an hsp which is basically your vertical speed and your horizontal speed um you do not need any variables you don't need to name anything the way that i'm naming them i just this is how i've developed over time um this is what i find works for me so we're going to set up this stuff and we're going to set up an attacking thing so attack equals false we want to set that false by default and then we'll add an attack timer which is going to be let's say we can attack every 25 frames the by default if you open up settings here by default game maker runs in 60 frames per second you can set this to 30 if you want but i think 60 is good because it keeps it very smooth so we're going to keep it at 60 so technically if i were to have this at 30 you'd be shooting every half second so let's put it at 20. so every third of a second you can shoot so i think that's all we need for now to be honest in the create event so now we're going to add a new event and we're going to create a step event which this happens every step of the game which is i guess technically like a frame it's going to run this code all the time consistently as long as the object is in the room and doing something so in here we're going to create some stuff we're going to create some controls so if you can comment stuff by just putting two slashes here so we're going to just write controls i do this just to break up my code make it a little bit easier to read and so how i set up controls how many other people have set up controls is i just kind of name them under variables so let's say key up so this is when we want to move up so key up is going to equal keyboard check which is basically going to check if the keyboard is pressing a key and then we can put in a key here if you're using you can you can do something like this you can do vk up and that will work fine um but you can also if you want because if we're going to be using the mouse and stuff you want to use wasd you'd have to type in ord that's going to that's for any kind of letter keyboard press and then just press in some some of these quotations here and then you want to put a capital w and this is going to how it how you can set up key bindings for any letter on your keyboard so it's a little bit more annoying but we're going to do key up key right key down and key left um and then we can just you know d s and a the corresponding things and there we go we have control setup which currently they obviously don't do anything but we have them set up so now let's do our movement i'm trying to go over this quickly so you i don't waste your time but at the same time trying to explain things so i hope you guys are okay with this we're just having to chill time so yes we got our things set up here and now we're going to have our vertical speed so vsp is going to equal the difference here the difference between key up and key down all right so um basically so actually these are reverse because how game maker works is the right and down are positives and left and up are negative so we're gonna have these actually reverse here um and and this should make sense but basically how this would work is if if this value so if you're pressing d key right oh sorry i meant s if you're pressing s key down is going to equal one if you're pressing w key up is gonna equal one so we're doing you know key down minus key up so this would technically be if both were being pressed it would be one minus one which equals zero so you're not moving in the vertical direction if key up was pressed and key down wasn't zero minus one equals negative one and so forth so we're going to do the same thing for the horizontal speed here uh key left for the negative and key right for the positive and yeah this should be a little bit straightforward and then all we have to do is just time this times this by our speed variable just in case you want to set up different speeds and stuff like that um so we're just going to times that for our speed because if these are always going to equal one negative one or zero then if our speed is 1.5 it'll always equal 1.5 negative 1.5 or zero um so yeah that's that's it that's all you got to do and then we're going to say x is going to plus equal so it's going to add your hsp every frame and same thing with our y y plus equals vsp and yeah so the x and the y are the actual coordinates of your object so this is what's actually going to influence what the object is doing we're going to end up setting up some shooting in a sec but actually we can do that now let's do that now let's be consistent and set up each object one at a time all right i think that that makes sense so shooting we're gonna do uh if attack equals false so if we are not attacking actually i guess we couldn't we we should do that differently so we're gonna set this up as key attack and we're just gonna make that another control here so key attack is going to equal uh let's say i guess it would be the mouse button right um i guess that makes the most sense so we're going to do mouse check button which is going to be the same thing and then we should be able to do left click key left does that work no mouse no i think it's mb sorry i haven't done this in a little bit but yeah it's mb left so there we go um so now when you have the mouse button left being pressed um then it's going to make key attack equal true and that's an easy way to set this up is if key attack and if you just put it in brackets it's the same thing as saying if key attack equals true same thing um so yeah so if key attack is being activated then we're going to check some stuff so the first thing that we're going to check is the timer so we're going to run this timer and we're going to say if key attack is equal to true if attack timer is less than or equal to zero then which these curly brackets is how you will close in uh a certain phrase um so if this is equal less than or equal to zero then we're going to activate the attack and so what we want to do is actually activate the attack so the first thing we would do is create attack timer back to the attack timer default so we can actually set this up we could just put this as 25 but unfortunately i do not like using ver like just integers and floats like that so instead we're going to create attack timer max and our attack timer max is just going to also equal 20 and that will work fine so then we can plug that in here and boom you guys got a nice recoil or sorry a reload system there very easy to set up and then the other thing that we would do is we would create the bullet and we'll do that after we set up the bullet so next we're just going to create another object and we're going to do oh bullet we'll set up all the player controls first so we're going to go oh bullet create this bullet create a create event you guys have done this before so your experience now and we're going to set up a few variables again so this time i'm actually going to set up it a little bit different i'm going to be using built-in variables so actually you know what yeah yeah we'll do that because it's it's the easiest thing it's not the most consistent thing but it is very easy so let's just say the bullet moves at a speed of three okay then we can set up our direction so direction by default we can equal to zero just because we're going to be changing this in the player object here we'll change that um but you just need to set it to some kind of default so let's set that up there and then we can just create a death thing a death sequence so death equals false the only reason i'm setting this up like this is because it allows you to do more with it if you want to in the future expand on this and create some kind of particle explosion um on the death effect you can do that um so this is just setting it up nicely we'll just go in here the only thing we really need here um is if death equals true then we're going to set instance destroy which is basically just going to destroy this object that is all that's going to happen because everything every other collision is going to work in the other objects the enemy object the wall object but yeah so that's good the other thing that we can do is we can create another event go to other and go outside of room so if this object is outside of the room we're just also going to destroy it just so it doesn't you know persist in the world and add more like you know add more objects to our room that isn't necessary so very easy to set up but that's our bullet and then we can go back here and then we can just set up some stuff here so let's now get rid of this code and we'll say instance create and we're going to put it on a layer so if you go into the room here sorry i'm doing these out of order but we have an instances layer and a background layer so our background layer we can just change the color um i like to just use muted out darker colors so we're going to do something like this just you know keep it basic keep it simple um so that's our background layer and then we can have our instances layer and we'll have let's just create a new layer so go right click on the layer properties and go create a new instance layer and we can rename this by clicking f2 on your on your keyboard and we'll just name this bullet so that's gonna be our bullet layer all right so then we can plug in this stuff here so we're gonna go x so it's going to take our players x so our player object x because that's what we're in right now our player object y and then we're going to add the layer so we're going to go bullet layer and then for the object we can just go o bullet to associate with the bullet object so it's going to create that object an easy way to plug in variables directly into this specific object is if you just name this so let's just say b for bullet so b is going to equal this line of code b will actually basically be the identification for this object that we're creating so we can go b dot direction is equal to distance to mouse um distance to point so we go distance to point and then we can just plug in our mouse x and our mouse y so that it's basically going to go from um i guess we could we could set up okay hold on let me set up distance to object i don't know that's that's not the right thing okay this is fine this is fine um so yeah we're if if you want to see it more specific all you have to do is click the middle scroll mouse button and you can actually read all of the documentation so it's it's very easy to set up any kind of thing that you're working with but because you can just look it up in the help and you can see how it works but this should work fine if we have issues we can fix it um but yeah so this is gonna set up the bullet so we create a bullet if our um if our attack timer is equal to zero then the last thing that we have to do is just to decrease our timer so every step of the game we're going to do attack timer plus equals negative one so every step of the frame it will minus off one value from our attack timer um and then i guess if you want to be safe about it you can just do if attack timer is greater than zero then we do this then we run the script just so it doesn't need to run into the negatives and we don't have to worry about that if you don't attack for a long time and that's all of our player code that is literally all of our player code um and then yeah so bullet and player is done so let's create another object we're going to create an o enemy i hope you guys are still following i hope this is straightforward enough we're going to create another script or not a script here we're going to create an event create event and we're going to set up a couple things here so we're just going to create a speed variable actually we could do the same thing that we're doing with the bullets so speed is equal to let's say 1 because that's slightly slower than the player's speed um you know what let's set it to like 1.75 just so that eventually these things will catch up to our player you can do whatever you want um it doesn't really matter it's your game so direction is going to equal um we can just we can just do uh direction oh you know what i set up i said i set this up wrong i did distance to point that's that's not the right thing that's not what we need we need the direction i am very sorry about that um let's check it here we need point direction that's what we need we need point direction i am so sorry about that so we're going to take it from our x and y values and move it to the mousex and the mouse y that's if you tried to run anything and you got some weird stuff going on that's probably what was happening but you know you fix you find your areas you fix them it's all good so we're just going to do point direction and it's going to be from same thing so we're going to go from our x and y so this is the enemies x and y to the o player dot x and o player dot y and i'll explain that in a sec so if you're trying to relate to a different object all you have to do is relate the object by putting in what object you want it and then put a dot to relate to it and then whatever variable or value you want associated so very easy way to you know link other objects in one object's event um so yeah very easy and i think this is all we need for the create event so we're just gonna copy this code now and then put it in the step event just so that this this information is constantly updating because we want it to to basically imitate uh moving towards the player so that's all we need um and then we can just do we can set up a nice little thing here and we can say bullet equals instance place i'll explain this instance place x y o bullet so this is basically going to check bullet is going to either be true or false here in this statement and so what it's doing is it's going to check if our x and y is colliding with a bullet object and if it is so if bullet does not equal no one so if it is hitting something then we can do any kind of code we want here so this is going to be our collision with bullet and so for this example we would destroy the bullet and also destroy the enemy you can set up if you wanted to you could set something up like hb plus equals negative five if you have some kind of hp bar i guess we could do that or you could just set it up the easy way and do instance destroy and just do it like that but i think hp would be more fun so let's set up an hp hp equals 10 and then we can set an hp max just just in case we don't need it for this example but just to be consistent we'll set it up like that all right sound good sound good i hope so so we're gonna do hp plus equals negative five so technically it would take two bullets to kill an enemy this might be a little bit difficult for our first game but i think it's okay and then we also want to relate to our bullet object so bullet dot death is going to equal to true and boom just like that that is how we get this nonsense working that is how we relate to the objects so that is how you do that i hope it's very self-explanatory and then we're just going to set another thing we're going to say if hp is less than or equal to zero kind of like how we set up our timer if it's less than or equal to zero then we're just going to instance destroy and that's it that's all we got to do um if you wanted to you could set up some kind of health regeneration by doing like at every frame you're going to plus equal 0.01 or something like that or set up a timer that every five seconds he gains back one health that's probably a better way to do it but i don't think we need health regen that's a little weird so this is good this is our enemy the only other thing we need to do is we're gonna copy this code again it's very easy to copy code and place it again so copy the code and then change this to player let's change all of these variables to player so we can relate it to the player object and then we are going to set um we don't really need to do this but let's just set hp equal to zero just so it destroys it on colliding and then we're going to say player dot death equals true and we can just set up a death a quick death for our player as well so we'll just say if death equals true uh we'll say room restart so this is just going to restart the room and if you ever put in a new variable like i did here make sure to go on the create event and set it to a default value so we're going to set it to false by default because we don't want to kill our player when he enters the room um and you know what this should be good we don't need this anymore actually so we set up a player we set up a bullet we set up an enemy so the last thing we got to do is set up the gun and the wall and we have a working game so guys we're almost there the we're gonna do the gun just because the gun is basically useless the way that we have it set up here it's pretty much useless so we're just going to take the gun put it on here and in the create event we're just going to say image angle equals point direction so same code that we've been using point direction our x and our y and put that to mouse x and mouse y there's a couple more things that we have to get done here so i'm going to try to get them done soon but we can set this up and this is really all we need so we just copy this code and we put this in the step event so it runs that code at every every frame and just like that you got a little gun that's going to move towards your camera so or your cursor so you can actually do something with it and then the last object is the wall object and the wall object is going to be very very similar we can actually what we can do delete this and we can actually right click on this and duplicate the enemy object and this is this is not as much of a wall as it is a obstacle or yeah it's not really a wall we can set up walls it's very easy to set up walls but this is supposed to be the most basic understanding of how this works so let's just set let's just get rid of this stuff we don't need anything in the create event actually all we need we don't need the direction and we can get rid of this stuff all we need to do is basically set our bullet and our player to die when we collide with this thing so it's not really a wall i guess we could call it uh a death thingy let's name it death thingy or death thing sorry guys i'm kind of weird sometimes but yeah so this should be everything that we need should be everything that we need i think we got everything set up here um very easy you know what we could do is we could just for the gun we could just set recharge equal to false okay and so what recharges is going to be if the we're going to relate to the player object so if o player dot attack timer is greater than 0 then that means that we can't shoot so this is going to be recharge equals true and then we can say we can send another statement and we can say else so if this is not the correct phrase that's happening so if it is less than or equal to zero technically that's what we're saying is by putting this else statement here it's connected to this we can say recharge equals false if i can type and then we can just say if recharge equals true oh i said rechange if recharge equals true then we can change our image blend which is basically going to be uh the color of our sprite so we can say image blend nope can't uh can't type so if sorry yeah image blend equals c underscore gray which that's how you set up colors you can type in whatever color you want and it should come up i mean as long as it's a relatively okay thing i guess red would make more sense we'll just it won't look too pretty but it it portrays the information better so just so you guys understand what we're doing again all of this stuff is things that you can customize that's what i'm trying to do here is set things up that it's easy for you guys to customize but we're going to do image blend equals c underscore white which is basically going to return it as normal another way to write this is just doing image blend equals negative one um it means the same thing but i think just keep consistent and you know have one precise method of doing things so that um that is going to be how we set this all this stuff up and so what we can do is just to make sure our player is never going to get destroyed but what you can do is if you want to destroy the player and the gun for some reason is still in the room you might crash your game so what you could do is anything that relates to an object outside of this object you can just say if instance exists so if this object is in the room and then just relate it to whatever object you want then carry out this code so if there is no player object in the room none of this code will will run um because we don't want it to run because there is no player to relate it to so it's going to give you an error um you can do this stuff for for the other objects as well but i think we're okay um because this this information is kind of also applying you don't need a player object in the room because then this would return false and it wouldn't run this code so we're okay there i think we're good on everything actually so um now we can just set things up in the room but just to keep it simple we're just gonna set up our character to create the gun on uh creation so we're gonna just instance create and then set this on the same layer um as the bullet so we're gonna do on our x and on our y um and then put this in the bullet just so it appears on top of the player and we're gonna say oh gun and that should be good the other thing we need to do is we'll create a spawner we'll create an o spawner object and that will actually be the last thing that we do so we're just going to create that at the start of the room as well x y uh it doesn't matter what layer this is on because it's not gonna be visible to us but we can set up a spawner object and that's gonna spawn our enemies into the room the other thing we need to do is make sure that our gun object is always equal to our player object easiest way to do that x equals o player dot x y equals o player dot y boom just like that we got our gun moving towards our player exactly it's just gonna have the same coordinates and that's all we got to do super simple the last thing is creating this spawner so in the spawner object we say enemy spawn equals false so this is going to check if we're spawning an object and then we create an enemy spawn timer equals let's say every 120 frames so every two seconds we create an enemy all right cool done nice good uh the other thing we need to do is create an enemy x so that or we'll keep it consistent enemy spawn x is going to equal by default just set it to zero all right and there that's good um let's also copy this create it again and just type in max just so we are consistent go to max add an event step event step boom done boom there we go um and then yeah so in here now we're doing a lot of the same stuff that we've already done um which is which is good because you guys should kind of understand what we're doing here but we're going to say if enemy spawn timer is greater than zero then we're gonna minus it off so if enemy spawn timer is less or is greater than zero then it is not equal to zero or less than zero so we're going to have to minus it off one every frame and then we can just set this up by saying else so if the statement is false then we can say enemyspawn equals true you don't technically need this extra line but i'm just making sure that you guys understand what we're doing here so we say enemy spawn equals true if enemy spawn equals true use those curly black brackets again and we want to set this up so we're going to re-put enemy spawn timer back to equal enemy spawn timer max so that this only happens once um and then we can create an enemy uh here and so how we're going to do this is we can actually we can randomize the seed rent typing in randomized just randomizes a c you don't need to do it but i like to make sure that it's always random just just in case it's it's just one extra line of code so it doesn't do too much but we can basically set this up so that enemy spawn x is equal to um and then we can randomize of some kind of variable so if we go into the room object and we see how big so our canvas let's just keep this at one thousand by one thousand so that's how big our room is is one thousand by one thousand okay um we can we'll set that up it'll set the room up after but so it's one thousand by one thousand so we can go um from the midpoint we're gonna we're gonna calculate this from the midpoint so let's set up um our x at equal to room width divided by two which is going to be the center and y equals room height divided by two so that way we're sending an object we're gonna do this actually for the player as well just on the create event so it's we're always going to be in the center of the room when we start the game um and now we can say we're going to take our x variable and we're going to add a random integer you can do random but that's going to give you float numbers which is decimal number decimal numbers sorry so i like to keep it with integers and just do i random range and we're going to get a range between two values so this value is going to be between uh let's say negative 500 and 500 so because if we're at the center point then we're at 500 by 500 so if we go to the maximum amount negative 500 is going to equal zero and 500 is going to equal a thousand basic math i think you guys are following but anyway so let's just copy this code and change this for the y so y and y um and there we go that's it that's all we got to do um it's not the perfect system because then technically we can have things spawn anywhere so technically an enemy could spawn on top of your player but maybe we'll do future episodes and expand on this project um we'll see i don't know i'm not exactly the best tutorial maker so you guys can let me know in the comments if you want me to make more of these but x so then we're going to say the x and y is going to plug in these variables that we just made so enemy spawn x and enemy spawn y and then we'll put them in the instance layer so instances and we're going to create the enemy object we don't need to relate this we don't need to do like an e equals whatever because we don't need any variables there we've already set up everything in our enemy object and just like that we have it working properly so this should be all of the code um as long as yes so the spawner is in the room the gun is in the room um bullets are created on impact the enemies are created from the spawner and the death thing the the collision collider object thing we can just place them in the room so you could just let me zoom in a little bit it's kind of far you could just drag oh once you're on a selected layer so let's go to the instance layer i guess we could let's create a new layer to go underneath and we'll just name this one uh let's say ground it's it's not actually the ground but i'm just trying to whatever you get the point um you can name this you know back layer or whatever you want to name it environment maybe environment is the best best thing to name it so you could drag this in or you could just click on the object if it's highlighted hold down alt and just create objects so let's create just a random room let's hope that we don't go in the middle of our of our room but we set up just a basic scene here right nothing too nice looking but it does the job it does the job and we're good to go so now let's just drag in our player on the instances layer and if you double click you can actually find these settings so just to make sure that there's nothing colliding with it let's just center it into the room this doesn't matter so we don't have anything here so i'll just show you guys i can put this over here and we're still gonna be created on this uh center point because we set that up in the room thing so that way you guys understand what's going on so if we run this code actually the last thing we need oh you know what i'll do it like this so we run the code but you guys are going to see that oh we forgot something so that's good you guys can see this is the fatal error message so it's good to always see because you're going to see this a lot so in the death objects we still have hp set up here and we don't have that variable so that is why we got an error but if we run this code now you guys are going to see that the game doesn't work exactly how you want it to work right attack me oh my god okay so yeah uh that's embarrassing okay so we definitely screwed up on the spawner there we didn't we didn't um okay so going back so our enemy spawn timer is going to equal 120. so if enemy spawn is equal to true we want to set enemy spawn back to false so that's why it kept creating things like all the time so this is going to work fine we set up our thing it's fixed now let's actually move this down to like 100 or maybe 90 every one and a half seconds just because maybe we can make it start at 120 so it starts at two seconds but then 90 sec or 90 frames uh for every every enemy that spawned after that so this is all good and the last thing is the room isn't set up correctly right and so we actually need to go into here into down here we can go and check these things so go into viewport cameras we want to enable viewports and then just go into the viewport zero just because that's default and let's make it visible and then set up this camera let's say we want our canvas to be uh maybe half of this size so actually that's still pretty big let's do like i don't know if this isn't going to be an exact prop this is going to give you a square but let's say 2 let's say 250 by 250 just because all of our sprites are just squares and stuff so it doesn't really matter but we can still set this to be larger this is our this is our camera property so this is how our camera is going to appear what it's going to view and then the viewport is how big it's going to appear on your actual monitor display screen so let's do let's do a thousand by a thousand just to keep the scaling correctly so this is going to work right but if i run the game we're just gonna see this we're just gonna see in the corner some black things and we're not gonna see our player so an easy way to set this up not the best way but an easy way to set it up is just object following go on to the player object and now we're going to follow the player object and this is our borders so this is where it starts to kind of move so because our thing is 250 we could set this up as 125 by 125 and this would technically be exactly moving on our player but i don't think you want that so let's just set it to like let's say 90. so um the borders would kind of come from all directions so if you want to like draw basically like imaginary lines it would come out 90 from each direction and so within that our player can move and the camera doesn't move but if we move outside of that um then it'll start to move towards the player uh negative one for horizontal and vertical speed is going to just equal like it'll just automatically move to that location so we could set it up like that but i'll show you guys uh if we actually introduce a speed how it'll work so there we go we got our thing going and our character is going to move around and the screen will move around with the player and everything is working um how we want it to work however if we set this to a value like 1 that's actually less than our screen so let's set these borders up even more so let's do like 110 by 110 um and maybe make the screen a little bit bigger because i found that it was a little bit too small so let's do that and then also maybe set up our our speed to be 2 and our bullet speed to be larger as well so let's set our bullet speed to be 4 and let's increase the rate of fire so by decreasing the amount of cool down time so now we got a little bit of a better game also the other thing i noticed is the gun was looking a little bit small so in the create event we can just add an image x scale so this is going to scale our image on the horizontal axis is going to equal 2 and image y scale is going to equal 2 as well so this is just going to double the size of the image it's not going to be the best game we made it in what 20 minutes less more so this is going to move so we can set up our camera to move default to our screen quicker but as you can see it doesn't kill the enemies right away you actually have to hit them twice it's a one two but it all works and is this the best way to do this no but look we ran into the wall and we died um so yeah i mean it's it's something right it's the start of something is it anything crazy no no it's not um let's actually just put this to 500 500 this is the starting position of the thing oh no wait we don't want that we want 250 maybe anyway it doesn't matter it doesn't need to be exact oh it's this value that's why so let's say let's set this also to 300 at 300 just to keep it almost centered so that way when you start the room the camera is already offset so it's going to be closer to the player there we go um and this is just going to work fine so we got our little gun we shoot i i really hate the red guys but you know got to do what you got to do so and then every time you run into an enemy or a wall you are going to reset the room so this is just a super easy way to set up a game um and actually also if you hit these the bullet is also to die so play around with it i might continue the series and we create like an actual nice looking game out of this but this is the honestly to me this is the simplest way to set up a game that is fun that you can play forever this game will never uh end until eventually you screw up and make a mistake this game's super easy but you can you can start to introduce other things we might do it for future episodes we might do this as a mini series where we just create a basic top-down shooter game endless shooter so if you guys want to see that hit the like button we've been growing the channel a lot lately so um i don't know if we can get i don't know how many views this video is going to get but if we can get 300 likes actually that might be a life we can get 200 likes i will continue this series and we will start introducing things like actual sprites um and a high score so you guys can actually get points from these guys we can maybe introduce a little hud so you can see how how much health the enemies have how much health you have we can set up a player health bar instead of just dying on command we can set up actual collisions all that kind of stuff but anyway guys this is going to do it for the first episode i'm not huge on making these kind of videos i do a lot more game development type you know learning videos and uh you know the devlogs and stuff but i wanted to try something out i wanted to do something different so i hope you guys learned something or had fun at least for a little bit but that's gonna do it for today's video so i'll see you guys when i see you i hope you learned something i'm gonna die there we go and yeah have a great day
Info
Channel: Reece Geofroy
Views: 12,097
Rating: undefined out of 5
Keywords: Reece, Geofroy, learn, tutorial, tutorials, how, to, hd, gamedev, indiedev, pc, programming, coding, how to create your first game, create a game, create your first game, develop a game, easy, video game, how to, how to make games, making games, how to start game development, gamemaker studio 2, gamemaker studio 2 tutorial, top down shooter game, 2d, pixelart, in depth tutorial, learn code for beginners, game development, gamemaker tutorial, endless, game, make a game, making your first game
Id: SCJ0zCm-dcg
Channel Id: undefined
Length: 50min 19sec (3019 seconds)
Published: Wed Jul 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.