1 free read left. Create a free account for unlimited reading + AI research.
Create free accountyou will create your first video game with game maker before this video ends you don't have to pause the video just keep running and however long this video takes that's exactly the time you're going to need to create your first video game with game maker studio - anytime tutorial tolas I've been using game maker for a very long time because it's easy cheap and fast which is perfect for indie developers with small teams and small budgets let me show you a couple of games that have been made with game maker so you can get a rough idea what you're getting into risk of brain under chance it has sold over three million times that's crazy hyper light drifter are selling their game for 20 bucks on Steam crash-lands rainbow hotline Miami such a cool game network has been tight a lot of streamers and youtubers down well overwhelmingly positive reviews thoughts we'll be watching actually tried to play this but it's really hard it was a really interesting game so yeah it's kind of a cool engine for making 2d
games then you got that so if you want to make 3d games this is not the video for you and it's all about the engine for you your sim unity or something like that this is for making 2d games in a very fast effective and efficient manner there's also an entirely free version which is obviously the one we're going to use in this video this video is for everybody who hasn't used game maker studio 2 before if you have made a ton of games in your life not at all it doesn't really matter as long as you haven't used gang maker studio - you will learn something new here quit now okay make your first game now if I kept re-edit Ola two things firstly turn on some music because that makes it more fun and more enjoyable secondly if possible put this video on a second screen so if you have a tablet or a second monitor just put this video on that screen but if you don't have that don't worry spells still work absolutely fine because every time there's something you need to Z I will tell you so as long as you ask you have sound you
can still click back and forth between whatever you're working on the video the main premise of this video is that you will be done before this video ends without pausing this video you can absolutely do that with or without additional monitors and screens also see it as a challenge try not to get distracted and try to keep up with my pace okay it's like a game if you can't keep up then it's game over can you keep that I challenge you find Ettore edit Oh last warning the real-time part of this video starts now only continue watching if you're ready are you ready 3 2 1 open a new tab in your browser and search for you you games you will find this website from you you games so now we need to find the download button for the free version this website might not look the same if you watch this video in the future but there will definitely be
a download button somewhere in this case it's when we click on game maker then we can click try for free today don't worry I will give you some time to catch up in case you missed that click on the top on game maker and then on try for free and then apparently we need to click on get free trial now they want us to create an account as we're just using the trial version will just use 10 min mail so you can pretty much use any 10 minute mail service you want I'll go with this one because it looks nice ten minute mail is basically a service that allows you to do email registration stuff without giving your real email that we're just gonna copy the email from this ten minute mail account right here and then we're gonna click on sign up and uu account page sign do that right now have you found this page already if not
just go to you again circum slash register okay catch up time go to ten minute mail come copy the email address you see there then go to the uu website click on sign up and then paste your ten-minute email address into the email field enter your email address confirm email address name just fill in your information hurry up a little bit we don't have forever you need to keep up with me gonna enter my password now we'll click on register after you
have clicked register and created your account head over to your ten-minute mail and voila the email with the activation link will appear click on that link with the middle mouse button don't click it with the left mouse button because then your tap will close we still need our ten-minute mail later to sign in to game maker so either say if your mail somewhere or just open or click on the link with the middle mouse buttons or the tab stays open click on the activation link and you should see your account has been activated please look in below that's what we're gonna do also still don't close the ten-minute mail tab we will need your email address one more time to log in later now click
on download so we're just gonna click on download I guess either Windows or Mac whatever you're working on on which platform I'm working on Windows I'm gonna click on download now it is downloading so I'll give you one more second to start your download as well okay I'm trying to go really slow here hope you can keep up and now while this program is downloading let me show you what you will see when you open it so just let it download in the background you don't need to do anything now just watch me okay watch here so that's what you will see when you open game maker at the left or at the right I don't know you can drag this around however you want you have your resources so basically those are all of the things that are required to make
your game your images your graphics go there your scripts go there your objects your levels everything you need to make your game has its own folder so there's a folder for graphics a folder for sounds or folder for levels so if we create a sprite we get an image like this and if we double click right here we can edit the image so let's just paint something fill this now if I click on click on the X on the top here will close and I have created my first sprite now if I had over two rooms double click on the room a window like this will open this is the room we are working in a room has different layers those work like layers and Photoshop so layers on top are over layers on the bottom so far we have a background layer an instance layer and now we will also add an acid layer you can do that by clicking on
create a new asset layer now I will just grab the sprite I created and drag it in can also change the size and the scale and if I click on play now I will see a window with exactly what I created in my room so far those two sprites are on the asset layer you can see them right here and if you turn off the visibility of this layer they obviously disappear so I will close that because my download has finished now and yours should have finished by now as well so I click show in folder and here I got the game maker studio installer double click that might take a couple of seconds now it's reopening I agree yeah sure yeah install this
I hope you know how to install a program it's very simple let's click on finish and now game maker studio should be opening so this is what you should see when you start game Aker enter your email address hope you have saved it somewhere or you have the tab still open so enter your email address that you've used for creating your games account and enter your password let's do a bit of catch-up time because who knows how fast your computer is just install the program
open game maker sometimes it takes a little longer to open so maybe that's why we should include a bit of catch-up time here's well skipping ahead in the video is fine just pausing and going backward in the video it's not allowed so if this takes too long for you just you know skip ahead a couple of seconds that's totally allowed and fine no problem at all so it loads and loads and loads and as I said just enter your data your your email and your password log in and I'll give you a couple more seconds just to make sure now what you should see is days and obviously you are going to click on new
and then you have two decisions drag and drop we're not interested in that and can make a language so basically the choice between do you want use drag-and-drop actions to program your game or do you want to use real quote-unquote real programming to make your game and I recommend you go with game maker language right away it's not that difficult so let's do that give it a name save it somewhere now what I want you to do is do the same things that I did while downloading game maker ok create a sprite and add them into your room I'll give you a couple of minutes to do that you should see the resources somewhere right click on sprites in the resources then click create sprite a window like this should appear then if you don't
know where to click you need to double click on the small image on the top or you can also click on edit image on the edit image button then don't draw something complicated okay because we don't have all that much time just draw a triangle or something like that fill it with a color with the fill tool and then you're basically ready to go by the way have a look real quick make sure that your image is facing this direction it should face to the right now in this view look right here click on your sprite you can see this little cross this is the median point the center of your sprite you want this little X cross thingy to be in the center of your sprite so just click into the center
your sprite and you're good open the rooms and the resources your seeds more or less double-click on the room to open it you should see a window like this then we need to create an asset layer you can create the asset layer here then simply drag the sprite you created into the asset layer and click play that's the small triangle I can at the top cool catch up time make sure the acid layer
is selected otherwise you cannot break the sprites into your room you now let's actually program something in order to program in order to code we need to create a new object so in the assets let's right-click on objects whereas objects it's above rooms right-click create object these objects are used to code stuff first of all you can change the look of your object object by clicking here where there's currently there stands no sprite if we
click on that we can choose one of the sprites we created and then let's make our object move for that we will take this events window add event and then you're gonna click on the very first thing which is create the create event so this code is called whenever we start the game whenever this object is created so right from the beginning as soon as this object starts existing this code will be called and it will only be called once so one cool thing you can do in game maker is just type in something like speed equals three that's all you need to write speed equals three and we'll see very soon what that does once
again if you didn't manage to keep up the first time create a new object choose the correct sprite for the object by clicking on no sprite and selecting the correct sprite when you have a new object click on add event select create event and then in the create event write speed equals three oh so we don't get confused let's either remove the asset layer or just click on the I so it turns invisible then we will select the instance layer so we can drag our objects and you cannot drag your sprite into the instance layer you can only drag that into the assets layer but you can drag your object into the instance layer so let's drag a couple of them in here let's hit safe and click the Run button
as you can see all of the objects are moving to the right that's because we gave them a speed if you couldn't keep up here's what you need to do go into the room disable the assets layer select the instance layer drag your objects into the room hit the play button look if anything moves if so then you did it correctly [Music] we can also give them a direction if we don't want them to go to the right we just enter Direction equals currently it's like this zero is to the right direction zero and then 90 would be up so let's try Direction equals 90 just
enter this and if you believe time and hit run or f5 we can also hit f5 to run your game as you can see everything's moving up awesome now let's try giving them a random direction that's also pretty simple all you need to do is type in Direction equals then you write random you open a bracket write 360 and then close the bracket and what this does is it gives you a random number between 0 and 360 so we basically set the direction for every single one of these objects to random direction as you can see all of them are
moving into a random direction that's cool and was pretty simple now let's actually make them face the direction they're moving in for that we just need to add one more line and we will write image oops angle equals direction this way our image angle though the direction the sprite is rotated in will be the same as the direction it moves in the way these equations work is pretty
simple the left side changes to be the right side it's not like in school that you can write something like this 4 equals 2 plus 2 but in programming these sides can be completely different this will basically turn into this so the left side will change the right side just to calculate what you want the left side to be so in this case as I said image underscore angle equals Direction will make our sprites face in the right direction as you can see the triangles are facing in the direction they are moving which is cool now if we want them to move backward we just add plus 180 now they
should move backward or they still move in the same direction but they face in a different direction you play as you can see now they're moving backward let's remove that plus one for a second so they move in the right direction again image angle equals direction so far we just have three lines in our create event let's add a new event let's choose other and outside room okay add event other outside room get a new window where we can code so that's what in the create event and what's in the outside room event this is called every time the object leaves the room and in
this case we're gone just gonna type Direction plus equals so you make a plus sign than an equal sign and then you write 180 look at this write it into your outside room event now what this does is it adds 180 to the current direction if we just said Direction equals 180 that would mean it would move to the left because zeros to the right 90s up 180 is to the left but if we say plus equals 180 we will take whatever this currently is and add 180 on top of it so it will go exactly in the opposite direction and we also want the sprites to look in the correct direction so
we're just gonna type image angle equals direction again this way our sprite will face in the direction that's moving again so now whenever one of them leave the room they should come back very nice so I think my plan is to use these arrows as enemies so let's try to create an enemy spawn system or something like this for this we will just create a new object right click on object create a new object then you will add an event and we will use a create event and then
we will use an alarm so an event that is called periodically to bar new enemies so in the create event of your new object type alarm equals 30 this time this way we set an alarm to 30 frames that's one second couldn't obviously also use a higher framerate but I'm not going to show you how to do this in this video and lets you yeah let's just type alarm equals 30 now we need to add an event in the same object and we need to use an alarm event and we need to use alarm zero in alarm zero we once again want to type alarm equals 30 so that basically resets the watch so in 30 frames this even will be called again which then again will reset the timer so
it's called again and again and again and again if we didn't type this year it would just be called once exactly after 30 frames here you have a bit of safety catch up time what we just did is we created a new object with two events a create event and an alarm event in both of these events we just set the alarm to 30 frames with alarm equals 30 now what we want to do is we want to create an enemy object let's actually go to our triangle and call it here where you can see the name you just type obj and me so we know what this is then we go to our second object and we call it obj spawn this will spawn enemies
so now we type in Stan's underscore create underscore lay then we open the bracket and now when you look down here in the bottom line you can see the inputs that this function requires or the formatting that you need to do so we need to give this function an x-coordinate and y-coordinate layer IDE or a layer name and then the object we want to create so for the coordinates let's just pick some set coordinates for now so for example 200 comma 200 let's use that as our coordinates that will be around here or something like this once again here you can see the coordinates of your mouse so
basically in the top here is 0 0 then when you go to the right the x-coordinate gets bigger if you go down the y-coordinate gets bigger so instance create layer 200 200 as our coordinates then as layer ID or layer name we will use instances so the name of this layer where all of our objects are on at the moment that's the layer we want to create our object on and the object we want to create whoops is obj enemy that's it okay little recap of what you should have you should have and spawner object with and create event that this alarm equals 30 and an alarm 0 event that says
alarm equals 30 and instance create open bracket 200 comma 200 comma instances imputations mark comma obj enemy closed bracket now obviously we need to put that object into the room otherwise it will not work that's a common mistake don't forget to put your object into the room it has this little question mark sign because we didn't give it a sprite but that's fine it doesn't need a sprite it's just our spawner let's remove all of this also it doesn't really matter where you put it let's click play now okay now an enemy spawns out of this that's cool
let's actually make them spawn from wherever we put the spawner the only thing we need to do to change that is go to our object spawner and change the coordinates where we create the object the object - x and y so these implemented variables we'll just tell game maker to create the object wherever this object is at so wherever the object spawners that's where we will also create our enemy because we probably want to Z our spawner let's create a new sprite and let's call it SP our bond just draw a circle or a star or something like that doesn't really matter just really quick doesn't need to
look perfect you don't have a lot of time close it click into the center of the image to you know put the pivot point the rotation point to the correct position then go to your spawner and select the correct sprite right here by where there's no sprite just click on sprite spawner now let's put it into the center of the room right around here safe and let's it play let's see if the enemies come out of the spawner at the correct position and in fact they do so test us and your game as well should
work in your game too just make sure everything works so far I'll show you my two objects again this is object enemy has those three lines and the create event those two lines in the outside room event and we have the spawner which has one line in the create event and two lines in the alarm zero event so now let's create a player object and the player sprite I want you to do that right now create a player sprite and create a player object with chest the player sprite you should know how to do this by now do it I will do it as well make the sprite face to the right
lose the sprite set the center point into the center of the sprite create an object we rename the object give it the correct sprite by clicking on no sprite and selecting your sprite now we have a player object let's place that into our room
so if you're done we will create an event and this time we're gonna go for the step event the step event is the one that is called every single frame so 30 times per second 60 times per second whatever your frame rate is that's how often this event is called it's the update event the step event so let's code something into that and we want the player to control this so what do we do we enter an if condition that works like this we write if and then a question something that we want to check if keyboard check so this will check if a certain key on the keyboard is pressed and into the brackets into the two brackets at the end right here we write V ke underscore write press tab and
right motion underscore ad this will basically just make the object go faster in a certain direction so the direction we want 0 zeros to the right remember and speed we need to take something relatively small because this is called every single frame and it will add up quite quickly so let's choose something like 0.5 let's go with all point 0.1 is probably enough let's be real here you now let's do the same thing for pressing the left duplicate this block and right VK left and set of VK right
but instead of Direction zero we will go with Direction 180 now if you press play or have I already the player object into the room yes I have if I press to the right my object will start speeding up to the right and if I press left it will start speeding up to the left oops I went outside the room come back come to Papa okay so this works the acceleration might be a bit too slow so let's maybe go with 0.3 or something like that don't forget to test your game if it's the
runs okay I guess that's fine now let's do the same with up and down you can do that yourself if you don't can have a look use VK up Direction 90 is up Direction 270 is down now if I use the arrow keys I can use all over the screen movement feels a bit
weird so if you want to have a really sharp movement let's just try that for a second we can just reset the speed to zero before this speed equals zero that's what we're going to type before all doing all of this crap right here and then we're just gonna use a much higher speed because if we reset the speed every frame we need to start with something a lot higher let's go with 10 the last number the speed you
now as you can see the movement is not that wishy-washy anymore it's very very sharp movement pretty nice if you want to have something in between the two which is what I want you need to choose a speed set somewhere in between let's go with let's go with two and then multiply the speed with something don't set it to zero just write multiply the little star and then equals this will equal this number with the thing we write now and we will write 0.9 and maybe 0.92 or something so this means every frame we will lose about 8% of our
speed and then we will add a bit of new speed if the player presses something so that should feel a lot better let's see yes it feels a lot better and I also want to give you some time to play test your games if everything still works do that right now move around a little bit in your room if it doesn't work don't panic just go back a couple of minutes he what you've missed and obviously game over because you didn't manage to keep up I can't really deal with the low framerate so I'll show you how to increase the framerate okay it's really painful to look at 30 frames you just
click here in options here in options you get give to main and then here in main options generally you should already see the framerate let's go with 60 instead of 30 you can also go for something way higher you can also go for dynamic framerate but let's choose 64 now okay 60s way better click on apply to apply 60 frames per second and now what you will realize when we hit play is that everything will be twice as fast oops now I'm moving really really quickly so I think if the enemy is moving a bit faster is fine but let's reduce our speed to 1 instead of 2 save that hit play
very nice quite difficult but feels quite cool now let's change the controls to a s DW instead of arrow keys because I think that feels a bit better and I want to show you how to do that we can also do it in a way that allows you to do both so let's just do that don't see a problem with that just duplicate the if line right here and instead of if we've right or and this way we will check if this is true or if this is true so if we either press the right arrow key or the key we enter here then we will add the motion to the right so in order to check a key we need
to type O our D then open my bracket right D because D is the key for right oh and we also need to put that in quotation marks and then we need to close the bracket so now we have two basically two brackets inside each other or keyboard underscore check open bracket Ord open bracket then quotation marks D and then closed bracket close bracket so now I can either press right or I can press D and both buttons will do exactly the same thing let's do this with all of the other keys as well just copy and paste those to the other keys and left is the a key up is the n:w key and down it's the S key
save that and let's test if it works you in fact it does I can control with both ASD W and arrow keys now which is very nice now let's check if we are hitting an enemy then we want to restart the room we want to restart the level this is actually pretty pretty easy to do just have a look right here click on at event in my player and then I'll click on collision and then collision with enemy so this is an event that gets caught every time the player collides with the enemy and what we type in here is just room underscore restart I'll
give you some time to do that go ahead do it now also don't forget to put brackets behind the room restart because it's a function and the function always needs brackets hit the Save button and press play now if I had hit an enemy the game restarts but it doesn't feel that good because the hitboxes are a bit too large in order to make the hitboxes a bit better double-click on your sprite then open this tab right here where it says collision mask and you will see a square you can go to manual right here that allows you to adapt the hitbox yourself but you can also make it a lot more precise just by going leaving it
automatic and going to precise precise collision checking this way will be pretty much pixel perfect collision detection it's a bit slower costs more performance but in this case it doesn't matter so let's just select all of our sprites go to collision mask and use precise collision checking I feel second to do that make your collision check-in cousin checking precise right here and then gonna test you when you're done you can test as well everything works just play your game a little bit if you hit an enemy
the game should restart now of course we shouldn't allow the player to leave the room right now you can just leave in whatever direction you want that's obviously not all that cool so let's go to our player object go into the step event and then we're just gonna type x equals clamp and clamp does exactly what it says it does it clamps a value between two values so you can basically give it an upper limit and a lower limit and you can make sure that the value stays in between those two
numbers so first of all we need to type the value that we want to clamp which is the x value then we need to type our minimum value which is 0 and then our maximum value which is room underscore width so the size of our room the width of our room now every time our the x-coordinate of the player is smaller than 0 it will automatically be set to 0 if it's larger than the room with it will automatically be set to the room with that's perfect let's do the same with the y coordinate y equals clamp y comma 0 and then instead of room width we're gonna use room underscore height I'll give you a second to do this save it click Save and I'm gonna check if it already works yes
I can still go pretty far outside so if you don't want that then you can just add a little bit to the clamping so instead of zero you can use maybe 40 and 40 as the minimum and as the maximum you can subtract 40 and this way we won't be able to go that much to that far to the edge move the game over here so you can so see the code and now I really can't leave the room anymore that's perfect
so once again this is our player object this is the code we have in the step event of the player and this is the only line we have in the collision event of the player if it collides with object enemy so I think this is a good time to take a break because we have a fully functional game don't worry how do you continue from here if you like game maker if you enjoyed this then how do you continue learning game maker how do you get better well firstly there will be more videos like this or similar videos on this channel especially if this video does well then expect to see a part two because what you're seeing on the screen right here we haven't created that yet that's another 30 minutes of work or something like that I will definitely link some game maker stuff on the end card right here whether that's my own videos or other game maker tutorial credits that I really like and that I think are good pick one go for it other than that thank you very much for watching thank you for sticking till the end wow that's really amazing
have an amazing day don't forget to smile make the world your playground and see you in the next one oh yeah
GameMaker Studio 2 serves as a highly efficient and accessible engine for independent developers aiming to produce professional-grade 2D titles. By leveraging the platform’s streamlined workflow, creators can rapidly prototype and deploy games, a capability evidenced by the success of industry-recognized projects such as Hotline Miami and Risk of Rain. The engine’s architecture emphasizes a balance between ease of use for beginners and the depth required for complex logic, making it a viable entry point for those looking to transition from conceptual ideas to functional software within a compressed timeframe.
The development process centers on the integration of sprites, objects, and GameMaker Language to establish core mechanics. Fundamental movement is achieved by defining variables within Create events and refining input responsiveness through Step events, where developers can implement friction, acceleration, and dual-input support for keyboard controls. Performance optimization is prioritized by standardizing the frame rate at 60 FPS, ensuring a smooth user experience while maintaining technical stability across the game environment.
Advanced functionality is realized through event-driven programming, such as utilizing Alarm events for automated spawning systems and Other events to manage object behavior beyond room boundaries. Collision detection is further enhanced through precise sprite settings, while the use of the clamp function ensures player movement remains constrained within defined spatial limits. By incorporating simple logic like room restarts upon collision, developers can transform basic assets into a cohesive, playable prototype. This iterative approach provides a foundational framework for game design, encouraging continued skill development through the exploration of more complex programming structures and engine features.
Thomas Brush · 2025
Comments