GameMaker Studio 2 - TURBO TUTORIAL - Make your first game in 12 minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Shaun, I don't know how busy you are or if you'll see this or not, but thank you so much for your free tutorials. Your videos got me started on the right foot for learning gms2 and your content is better than some of the paid tutorials I've come across!!

👍︎︎ 46 👤︎︎ u/[deleted] 📅︎︎ May 10 2021 🗫︎ replies

Immediately excellent.

👍︎︎ 8 👤︎︎ u/JB4GDI 📅︎︎ May 10 2021 🗫︎ replies

Contrary to popular belief this tutorial doesn't requires cocaine

👍︎︎ 6 👤︎︎ u/Sevla7 📅︎︎ May 11 2021 🗫︎ replies

I don't have time to watch this just now, but I wanted to thank you for it. All of your tutorials are aces, Shaun, and you're a big part of how I was able to get started with Game Maker after years and years of no real progress.

👍︎︎ 3 👤︎︎ u/GameDevApprentice 📅︎︎ May 10 2021 🗫︎ replies

LOL you would release this the day I upload my first tutorial.

Seriously, thanks for all the videos you've made over the years. They've helped me quite a bit.

👍︎︎ 3 👤︎︎ u/kevynjar 📅︎︎ May 10 2021 🗫︎ replies

Hey Shaun!! I've been following your tutorials for a long time now! So nice to see you in this forum dude!Keep on the good work, I'll keep learning thanks to your videos <3

👍︎︎ 3 👤︎︎ u/NickTactics 📅︎︎ May 11 2021 🗫︎ replies

GAME CREATION SPEEDRUN WR ANY%

👍︎︎ 3 👤︎︎ u/c_dodge 📅︎︎ May 11 2021 🗫︎ replies

Hilarious... who are these people stating you don't get to the point?

I'm sure this video was just for fun. After using gml for a while I found that this pace was actually just fine for me... For beginners it would be a lot of pausing and rewinding frustration I think if they were actually trying to follow along. It worked as well with the quick video edits you did...

Now what does it sound like at double speed 😅?

👍︎︎ 1 👤︎︎ u/1mbcorp 📅︎︎ May 11 2021 🗫︎ replies

Sean thanks for all your tutorials! I sometimes see a lot of impatient people comment on your pace, but it's honestly perfect for the silent majority of us who want to learn things comprehensively. Hope you aren't actually bothered by them, and just want to let you know that learning GMS for me would be impossible without your tuts

👍︎︎ 1 👤︎︎ u/Donut_Kin 📅︎︎ May 11 2021 🗫︎ replies
Captions
all right open game maker we're making a game gonna go click on new we're gonna click game maker language not drag and drop don't be scared we're gonna call it making a making a game i don't care what you call it call whatever you want uh we have a game there's nothing in it we're gonna make a sprite so right click in sprites hit create uh go to sprite i'm just going to make a new sprite 32 by 32 that's fine now i'm going to name it anything we don't have time to name things i'm just going to get yellow i'm going to get filter nice big yellow black and that's fine just get this brush we're just going to draw a little happy face that's our player isn't that cool now i'm going to right click in objects we're going to make a new object we'll actually give this one a name that's probably important we're going to call you oh player i'm going to set the sprite to be the sprite of uh the the thing we just made okay so that's the image that's the player object okay understand so far good we're going to go to rooms and go into the room and we're going to click go play and we're just going to drag him into the game world just like that and we're going to press f5 run the game wait way too long and then we get a little game up that's our game okay we've got our game objectives in the game he's a little happy face he's real happy okay all right once you're done celebrating we're going to come back to oh player we're going to have an event we're going to add the step event this happens every single frame of your game very very simple i'm going to type if keyboard i'm just going to check open bracket uh vk uh left x equals x minus three and then i'm going to take this line i'm going to copy it i'm going to paste it a few more times and i'm going to change vk left to be vk right and then vk up and vk down this is our arrow keys telling us how we're going to move all right um left and right going to move our x position um right needs to increase it the left needs to decrease it up is going to change our y position it's going to decrease it down it's going to change our y position it's going to increase it okay don't worry about the white space and stuff you can leave whatever spaces you want really doesn't matter anyway we've got all that stuff there we've got him in the game if i run the game now it'll take way too long as it always does but it'll run and now we can actually move there we go we have it game of the year folks we did it made a video game we can move around isn't that great we are not done yet no not by a long shot we're gonna make a new sprite and right click and surprise and hit the create sprite we're going to resize this because we want our enemy to be a bit bigger we're going to type 48 into here uh so rather than 32x32 it's 48.48 we're going to get a red color i'm just going to click there um and then we're just gonna you know make him just kind of look angry and yeah that's a sprite and we're right clicking objects hit create object we're gonna call this one oh enemy okay so it's probably important for this type of name uh assign it to have that sprite now every frame we just want the enemy to move towards the player so i'm going to add the step event once again i'm going to take x i'm going to um set it to equal itself plus length the underscore x we give it a length in the direction gets that amount of like x in that direction uh the length is going to be like uh one and a half because we want to move slower than the player does so the player has a chance and then the direction is going to be point underscore direction uh open bracket x y o player dot x o player dot y close bracket close brackets let me go on all right i'm going to copy that line i'm going to paste it and i'm going to change the x's here to y's and the x here to a y as well and this just means every single frame is going to move from where it is towards where the player is by 1.5 okay really simple if we go into the room now we can play some of these around if they look really silly uh we're going to press f5 and click ok to this game is going to run and then we're going to see these dudes coming towards coming towards the player no matter where he goes he touches them nothing to happen so that's bad we want to fix that so we're going to make a game over i'm going to make a new room okay this is just going to be our game over room we're going to make a new sprite uh we're going to make it super big okay we're going to resize the canvas make it like 640 by 360. that's the size of my room at the moment i'm going to edit the image and i'm literally just going to grab like the biggest tool i have here and just be like game over yeah that'll do then i'm going to come to room two i'm going to add an asset layer and then i'm going to click on that i'm going to hold alt that will just allow me to sort of drag it in and click wherever i want boom okay simple stuff game over room um then when we go to oh enemy i'm going to add a new event for if it collides uh with oh player and if it does we're going to do room go to next rank close bracket um the semicolon is optional it's just good programming practice okay don't worry about it you cannot put it there semicolon scares you don't put it in it doesn't matter okay then i'm going to run the game once again just so we can see a bunch of enemies they move towards us if we touch them boom game over simple as that you probably do want to make it so you can actually restart the game so when we go there it's kind of a soft lock so i'm going to right click and make a new object object three whatever add an event uh key pressed letters um ah this will just happen whenever we press the r key if this object's around and just do game underscore restarts okay open close bracket and then go to uh room two that we just made object three and just like you can just make sure you've got the instances layer selected then just drag that object in or you can hold alt and click and place a million don't place a million just place one okay we've got one of those now we run the game there just to make sure we're gonna get hit by these come to game over if i press our game restarts we can play again okay good stuff now this game isn't very fair we touch an enemy we die there's nothing we can do so we're going to give us something to fight back i'm going to give it a bullet okay so i'm going to right click uh in sprites we're going to make another new sprite um we're just going to go to edit image i'm just going to have i don't know a big circle brush put it there i'm going to go to image um auto trim all frames just to shrink it down that's what 15 by 15 yeah that's fine then i'm going to make a new object and call this oh bullets okay we're going to assign the sprite to be that sprite we just made and we're going to add an event for if this bullet ever collides with an o enemy and if it does we're going to do with other so that means any kobe right now is going to affect the thing we've just collided with not this object itself in other words affecting the enemy we're going to do hp minus minus okay that's gonna reduce one from the the hp value that the enemy has which we haven't given him yet but we'll get to that and then i'm also um i'm gonna write underneath instance underscore destroy okay which is gonna make this instance go away so the bullet's gonna go away and we're going to reduce the hit point of the enemy by one and we don't have hit points but we'll fix that we'll go to oh enemy go to we're going to add the create event so when this object gets made for the first time i'm going to set hp to equal five now every time it hits a bullet the bullet gets destroyed and it gets reduced by one and then in the step event if uh hp is less than or equal to zero if that's the case then destroy this instance instance destroy then we just actually need to be able to make our bullets i'm gonna come to oh player we're going to add um the a mouse event we're going to go for left pressed so every time we press the left mouse key we're going to do uh with instance underscore create underscore layer this is going to make a new instance of an object uh our current position x y the layer is just going to be the same layer we're on the object is going to be oh bullets okay close the bracket and close the bracket again open a block because we're doing a with statement again so everything we do in here is going to affect the bullet not the player we're going to set direction to be equal to point direction uh x y wherever the player is and mouse x mouse y that's wherever our mouse currently is i'm going to have speed to be like six or just something kind of fast okay and that's just going to make a bullet every time i press the left button so if i run the game now and i move away we can find absolutely nothing happens for some reason what have i done oh yeah we need to change this this is left pressed um left press just means whenever we click on the player whereas we want to change that to a global left press that's just whenever the left mouse button is pressed in general okay easy mistake to make run the game again now i can shoot these bullets you see they're kind of coming from the like the top left of the player and that's because i'm an idiot and i didn't set the origin point on this sprite so come to this sprite uh click this thing over here that says top left go to middle center you see this little point go to the center of it now when we run the game that's actually treated as the center of that sprite so you see the bullets actually come from the middle of the sprite now and it just looks a little bit better okay now we're gonna go one further than this because uh this is pretty straightforward we're gonna actually make the enemies flash a little when they get hit okay so i'm gonna edit this sprite first of all we're gonna click on this frame i'm gonna copy and paste so it has two frames a frame zero and a frame one and on frame one i'm gonna take the white uh color here and the fill tool we're just gonna make it like white so as if it's like flashing white okay um now we don't want that to animate because that'll be a bit yeah you don't want to look like that so i'm gonna go to oh enemy in the create event here i'm gonna set this to be image underscore speed equals zero that will stop it from animating i'm also going to set image index to be zero which means we're going to definitely have that very first frame okay it goes frame zero frame one it counts up from zero don't ask why now we're going to make it so that when a bullet actually collides with oh enemy or as well as reducing hit points we're gonna set image underscore index the equal one so we're going to set it to that white uh white frame so it looks like it's flashing okay but in order to bring it back from that we need the enemy to automatically set itself to be the normal one again if we do that in a special event called the begin step event rather than the step event this will happen at the start of each frame before any of that stuff happens so it guarantees that when we get hit by the bullet which will happen after this and we change white uh at the beginning of the next step we're gonna change red again so i'm gonna do image uh i'm gonna do image and store index equals zero here but if i run that now uh and i shoot these bullets you can see just for one frame when they get hit they actually do a little white flash okay now the last thing we want to do is because we just have three enemies here and they we kill them and the game's over we want them to keep spawning forever so we kind of have a bit of a game loop all right so i'm going to make a new object in the object 5 whatever it really doesn't matter then i'm going to add an event i'm going to add the create event i'm going to set time to equal 60 like 60 frames well that's one second uh 60 frames a second alarm 0 is going to equal time alarms go off when they count down over time and when they hit zero they go off so i'm going to add a alarm 0 as an event and when this alarm goes off we're going to make a copy of the enemy so instance let's go create and just go layer um and and the x and y is going to be random so i'm gonna do random 640 that's the width of our room uh random 360 that's the height of our room uh layer whatever and oh enemy is the name of the thing we're making okay um and then time is going to equal max time minus 1 10 okay max returns whichever is bigger of the values you put into it alarm 0 is going to equal time okay that just completes the loop there we're just going to make every every 60 frames we're going to make a new one of these and we're going to reduce that amount by one so then it's 59 frames every 58 frames and so on so we're going to make faster and faster it's just going to get crazy okay i'm going to go into room one we're just going to place a copy of object five here we're gonna get rid of the enemies that already exist um we're gonna run the game you might run into an issue where it spawns on top of the player but we'll fix that i just wanna see if it generally works yeah we've got some enemies that's spawning in and yeah one spawns there that's not very fast so let's try and fix that we're just gonna give them a little bit of time okay so i'm gonna go to oh enemy we're going to add in the create event uh can kill the player equals false so when this gets made it can't initially kill the player we'll go to oh player here um the collision event with oh player and we'll check if can kill the player equals true room go to next it will only do that if can kill the player equals true and then also in the create event alarm 0 equals 60. so after one second has passed alarm 0 is going to go off and then we're going to set can kill the player to equal true so there's going to be one second where one of these spawns in where it can't kill you in fact we can even go on further and make it so it can't move until that time is up so if we're just coming back into the step event here where we do our movement i'm going to say if can kill the player equals true and just wrap these in some curly brackets like that so it'll only do this stuff now um if that's actually true so if i run the game now we should see that these now we have this player here these guys spawn in they they look menacingly at you for a few seconds but they can't actually kill you right away until like a seconds pass kind of hard to test that and get close enough to one to find out but like that one there probably would have killed me uh if it was how it was before and then eventually we touched the game over there we have it we made a video game a lot of people complain that you know video tutorials don't get to the point so i tried getting to the point let me know what you think um if you actually maybe want me to make this exact tutorial again but like explain what the hell is going on let me know in the comments below maybe i can do that otherwise thank you very much for watching
Info
Channel: Shaun Spalding
Views: 29,238
Rating: undefined out of 5
Keywords: Game Maker (Video Game Engine), Tutorial, GameMaker Tutorial, GameMaker, Game Development, Indie Games, Tutorial Series, Game Maker Studio, Making Games, How to make games, GameMaker Studio 2, GMS, GMS2
Id: dKSJ8IKpa28
Channel Id: undefined
Length: 12min 1sec (721 seconds)
Published: Mon May 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.