Making Your Own Games With GameMaker Studio 2: GameMaker Language | Gurpreet Singh Matharoo | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Making Your Own Games With GameMaker Studio 2: GameMaker Language

teacher avatar Gurpreet Singh Matharoo, GameMaker Mentor and Instructor

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

21 Lessons (1h 45m)
    • 1. Class Introduction

    • 2. A1 - Programming in GML

    • 3. A2 - Making the Player Ship

    • 4. A3 - Making a Background

    • 5. A4 - Shooting System

    • 6. A5 - Enemy Ships I

    • 7. A6 - Enemy Ships II

    • 8. A7 - Enemy Ships III

    • 9. A8 - Health System

    • 10. A9 - Losing

    • 11. A10 - Score System

    • 12. A11 - Powerups

    • 13. A12 - The Menu

    • 14. A13 - Adding Sounds

    • 15. A14 - Creating An Executable

    • 16. B1 - Movement with Keyboard and Mouse

    • 17. B2 - Sprite Animation

    • 18. B3 - Collisions

    • 19. B4 - Tiles and Autotiling

    • 20. B5 - Camera System

    • 21. B6 - Draw GUI (Tip)

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Ever wanted to learn how to create your own games, but found it hard? You're at the right place!

Through these classes, you will learn how to code using GameMaker Language to create games in GameMaker Studio 2, the engine that gave us Undertale!

The classes start with an introduction and some explanation of the basics. After that, you learn to make a shoot 'em style game.

After you finish the classes, you will be able to build your own games - you will become a game developer!

Meet Your Teacher

Teacher Profile Image

Gurpreet Singh Matharoo

GameMaker Mentor and Instructor


I'm Gurpreet Singh Matharoo, a GameMaker Mentor and Instructor. I love making games, but even more than that, I love teaching others how to do so. I have done so through my tutorial website (GameDev Palace), Udemy courses and my Discord server (GM Helpers).

I've also been featured on the YoYo Games Blog as a guest writer.

Check out my classes if you're interested in learning GameMaker!

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Class Introduction: headier American to my course. I am corporate and I will be your instructor. In this course, I will show you how you can create your own games easily with gamemaker studio, too, in discourse indicating a shooting of cell game is in the bend in programming language off gamemaker studio to called gamemaker language. This language is very littler and simple to use. I will be guiding you through the basics off the language. So even if you have no experience in calling at all, you will have no trouble in pulling the scores. When you finish the course, you will have the knowledge you require to build your own games and a base to learn and do more in game maker. So what are you reading for signing for the course now and let's get started. 2. A1 - Programming in GML: Hello and welcome to this lecture where you learned the basics of programming and how to write code. But if you already know how to go, the new miss give this lecture Variables are words which can be used to store some value, which can be a number, some text or some other value. To assign some value to available you simply type of able name put unequal sign and time the variable value, for example. Here we create a variable named money. I can use a able to store anything, but we just variable. I lose it too strong. The amount of money w has. So first of all, we need to create a variable this originally done in the creative mint. So here I am, created out of money with a value of zero. So this is called initialization Now say I need to add one to the value of money each step . So for that, I look on the step event and here I will type money plus equals one. So each step this will keep adding one to devalue off money. Okay, so now we know how to create variables. But how do we use them? actually using other able is quite simple. So as an example here, I will create a variable called a good value off to and the way it will be when Value oak tree. So now I can use them in mathematical expressions as I want, so we'll create every well called C and here bless me. So now see will become five, because a plus B scrupulously, despite functions are used to perform an action or done some value, there are many functions that just perform in action who are examples. This function instance create here is used to create a new business, often object at a specific place and a specifically here. Another function called instance. Destroy is used to destroy the instance off the objecting the court for here. If I don't intend destroy this intense off, their zero will be destroyed from the room, the function wrote Next can be used inside the ointment and is you still draw some texts at a specific place. There are many functions that just return some value. For example, there's a function called random. So here, if I type equals and them 10 dysfunction was like any number from 0 to 10 for the variable A. There is another similar function called Jules. So hair if I type a equals Jews, one do dysfunction will select any value. And normally from the numbers west fire inside experiences. So here it will select one or two randomly poured, available A. So you have some cold in the strep Ament die event Dental difference. So the court inside it runs always to. But what if you want to control it? What if you wanted to run in certain circumstances and not in others? For that views conditions, the most common condition used is if so Here. If I type this so, constable, According to the school, one or two will be assigned toe. So here this is the condition. So here, if is equal to one, we will become too. Because if this condition is to the court inside up early brackets trance. But if this condition is false, if is not equal to one then this court will not run. Now here. If I type as and again at this curly brackets on here, type the cause one here. If this condition returns false, if is not equal to one discord after, as you don't. So if a is equal to one this cold within. But if it's not equal to one, discord were their cell conditions work. So we're done with the basics. Are programming if you don't get all of it? Not very you learned when you start to your scored suing the next lecture. 3. A2 - Making the Player Ship: Hello and welcome to the lecture. Where will make the player ship for our game To start getting up leadership, we first have to create a spite for it. So for that first of all, a nightly gonna sprites folder and select create. I'll end this right SPR underscore. Clear. Now you have two choices. You can you repeat to known Sprite inside the imitator. Or you can import a sprite saved on a computer. I will get my own sprite right here if you want. You can change the size of a sprite by clicking here on drink of it and hide here. But we will not change a sprite size because will use of the false part size that 64 by 64 . No, I've heard image to start doing now. As you can see, this image I turbaned opens here I can grow my sprite. As you can see, there are many tools you can use to joyous, right? You can select the car from here or by clicking here. Now, when you're done doing this right, you can close the immediate er tab here. Make sure religion the Origin Doh middle center and then close I mean, no, I know that I'm done doing the sprite. I need to pay it an object for double your ship. The road that I rightly called objects fuller and select create an object will be created and I'll name it. No, we need to assign despite object, which I can do by dragging this bright from here and dropping it here. No, we can start putting up layer, which we will do in the step event. But first of all, we need to create some variables in the creative meant a grand a variable called moving the score speed with a value of four. This will be the speed at which are clear. Ship will move. No, we can start coding in the step event. I learned a step prevent and held. I have some court. The function keyboard returns true if the keys past part is being pressed. So if the night is being pressed, the value off move speed, which is four will be added toe X, which is a horizontal position off the object. So by adding two X, the object will move to the right. But if the left key expressed the value of most speed will be subtracted from X, so the object will move to the left. Now I'll do something similar for the vertical movement by is the vertical position off the object? So when I pressed, don't the value off most really will be added to buy, so the object will move downwards. But if I pressed up, the value off move Street will be subjected from by and object will move upwards. Now that we're done quoting the pair object, we need to ready a room for that. I'll open the rooms. It'll that's already present in the project. Click on it and it will open in another tab. So first of all, I need to send the size for the room. For that, I'll go to room settings and enter 6 40 end of it and 40 in the height. This is the size will use for the room. Now we need to place the air object inside the room. For that, I can just drag the object from here into the room. So now that every basic thing is ready despite the object in the room, we need to test. If it works for that, I can click on the play button. Oregon just hit a flight. No user arrow keys to move the ship around. You can see that it works as intended. You can close them and don't know. Now you've made your first step towards making your first game. See you in the next lecture. 4. A3 - Making a Background: loader and in this lecture will make the back rooms for our game. In the previous lecture, we made the player, ship and ability to control it. Now we need to create good looking backgrounds for the land and the clouds. First of all, I get a new poll reporter backgrounds in tight inspired Supporter For that are click on the Spikes folder and select at Group. This will get a new polar inside the Sprites group and here I can name it a name. It back out will store all of the bagel sprites inside this folder. Okay, just right. Click on the Bagger folder and create This will be the new Sprite and I'll name it. Be glad we're begets turned for background. I'll started size by opening this menu and here on the right six body general dislike that maintain aspect ratio Dick books and hair type 40. So this side 6 40 40 is the size of our game in the room, and this is the size I'm going to use for the bedroom. Now I click on Edit Image and I'll draw the background. No, when you're done growing, you can close the tab and you're gonna close this window? No, I create the back on for the clouds. For that, I'll create another Sprite inside a backers fuller, and I'll name it. We get clouds, another against size to 6 40 and 40. And I needed. And now we'll get the bag on. We just need to get some clouds here. No, the compute image. So leave some space so you can see the land. No, I'm done creating the clouds. So I close these. Now that we're done creating the Bangles price, we need to place them inside the room. So I looked in the room. No, look at the layers menu. They are two years. One is, for instance, is another objective. Changes go inside this layer and the earlier is for the background. No, I need to assign the land dragon toe this layer. So I'll drag this vehicle and background and I drop it here. No, I'll zoom out of the room and you can see that the Landrigan has been assigned and it's looking good. I click on this layer rust after, and I'll name this land. No, we have another background for the clouds for that. When you took it another earlier, so I don't care. Adoption for Pete. You back earlier on a new bag unbearable to be created. So here I designed the clouds. Right. So I'll drag it from here and drop it here by pressing the have Toki renamed this layer to sky. Now we have the first folio assigned the back and stretch to the room, but we need to make them moving. For that I want to work Click on the Land Lear And here in the land properties here, we need to enter the speed into the vertical speed option because we need the beggars to move backwards because we need to get delusion that a player ship is moving forward. So here, Mylanta door. So now the vertical speed off the land background is two pixels per step. So now I'll open the sky background and in its vertical speed, I'll die for no. See that this Beckham has gotta speed because the clouds are closet dealership and will appear to move faster. We also need to enable the vertical tile option for both of these layers so that the back on just keeps on going. No, we can run the game and see how it looks. You can see that the bag on this moving and the clouds appear to move faster than the land . Now this gives us allusion that a player is moving forward when in reality, it's just a background that's moving backwards. No vehicles at school amid the backwards were again, and he looks a lot better. So you in the next lecture. 5. A4 - Shooting System: header on in this lecture. We're going to make the player able to shoot. So first of all, we need to be in the Buller. Doppler will shoot. So for that I create a new sprite named SPR Bullet and junior size to Advait. And now I could you draw a bullet? It's know that I am done during the bullet. Oppose this, Jane, the origin to middle center and clothes too. So, as you might have guessed, I'll get an object. No, and I limit over Gibraltar. I'll assigned a sprite. So this is the bullet object. And we needed to move upwards at a bird speed. So I had a great event. And here I'll type the speed equals Afghanistan. So this will change its what it will speak to my understand, which means it will move upwards at a speed off 10 pixels per step. Now the bullets will be destroyed when he reaches out of the room. So for that I had just happened and here learned some court. Why is the vertical coordinate off instance It becomes negative when an instance which is beyond that boundary off a room. So when this instances why it's smaller than minus 20 which means that it's 20 pixels beyond the toe bone re off the room diet stance will be destroyed. Now the bullet object is fully ready. We just need to open the object player object and in the strap event had some more court to make a player able to shoot. So going to this court when the space key expressed, not held, just breast once it will create now. Budget Weird. Instance 16 pictures above the player. As you can see, this is the X coordinate with Nice just will be created. It is the y coordinate where I've used why minus 16 degree in time stand 16 pictures above the player. This is the instance that we need to create where we abused over the bullet. And this is the layer where we need to pay the instance. If you don't know which led to use, Open your room and Jack, which earlier you have 14 instances by the $4 is named Instances civilians. That So now that we have implemented that should in Grantham, we need to test again. Click on play no, best space and see that it shoots. No, you can make some changes if you want. For example, you can open door with a bullet object and in the pediment jmw speed. So I continue in this 10 to 20 and if I don't know, you can see that the world goes faster than before So you can change. Just do that where you like you can also open the object here object. And here chain Ducky used to shoot the bullet. So here I've used space. So if you want to change it to, say control like an entry Control And the rebels showed the bullet when I pressed the control key. So we are done making a player able to shoot. But what is there to hit in the next lecture will make some enemies seal there. 6. A5 - Enemy Ships I: welcome. And in selector, we're going to create the enemy ships. Of course, most of all, we need to make the spray, so create a new sprite. Name it SPR Enemy 64 Positive or Sprite Size is fine. So I created the hypno. But no, I'm done doing the ships like Moses and change our it into middle tender and closes to. So no, we need to create an object for the enemy. I'll name it for BJ enemy Douglas Wright. No. When the enemy entered the room from the top, it needs to move now. That means we need to set a poster vertical speed. So I learned the creativity and held I the expiry because for so this will set, it's where he goes paid to four, which means it will move down at a speed of four pixels. First chapter, No, we need to make it so that the enemy object got destroyed once said to just be on the bottom boundary off the road. So for that, I learned a separate went and who knows? Room height is the water monday of the room. So this cortex, if the instance Harry's title, because beyond that boundary. And if it has destroyed the insurance, nobody to create another object named What would you mean? This will be a big object which Billy was to create over the enemy stances. They are to a protester doing this. So I showed them both here. The first approach involves using lamps. So first of all, I learned the creative meant and here I alarmed. Zero equals 30. So this was heard the alarm 0 to 20 steps. Which means that volunteer event, which can be found here, will be executed 20 steps after this court. So by default, 20 steps is one second more learned. Alarmed, You know, I went and here and I have some good dysfunction will create an instance. Or for BJ enemy that I don't know, Max value up to the room with on trade because above the tall boundary off the road and this line of court will again set alarm village already straps. So after this court alarm, zero will be activated after 20 steps again. So this alarm will keep looping and getting over the enemy stances after 20 steps each. The second approach involves using this te prevent and there's Lord used lumps supposed to fall, I learned, appear different. And here Al Qaeda variable name timer and set its value to hurting this way but didn't go to end timer value. So now I learned a supplement. And here there's some court This court will use one from the time of our table each step. So after 20 steps in time, we will become zero. I'm taking it. That timer has zero, and here I like. So there's line of court cleared son instance off the enemy at a random X value up to the room rich and it's the same line. Views Gene approach one. And after this I remember we said 2 30 again. So Gainer, for 20 steps it will be done to you and again dying cells will be created and again so this way they look will keep on going. And it's kind of similar to the alarms fielding approach one. So now that I'm done according the objects, I'll open the room and I'll drag Doboj main object. Yeah, you can see that it shows a question about care because we haven't assigned a sprite to an object and we don't need to because it's just a Meghan object. So no, it's time to test again. So now I have restaurant. You can see that the animals are being spawned at random horizontal values. No, If you want, you can open the uber Jenny meal object and the great event. Jane. Dude, sweet spirit here. I would like to increase it to say six. So if you just again now, you'll see that they move faster now so you can adjust it to your liking. You can also open over Jimmy in and here said that diamond to say something larger. So I sent it to 60. So each lobe it will take 60 seps to one another instance. So, as you can see, they come kind of lead, so you can just doing, like in tow. So that's all for this lecture. See you in the next one. We will make the enemy is able to show 7. A6 - Enemy Ships II: welcome. And in this lecture, we're going to make that, um is able to shoot before starting that made or something. If you want to Exactly appreciate my example, make sure you use the values I am using. So make sure you have these values. In our view, Jebalya double spirit should be done. Inevitable it. The the spirit should be my 30 in our budget enemy. No, the spirit should be six. And in obedient man supplement the time I should be 50. That's job. No, first of all, I mean to do a sprite for then we will it. So I could a new sprite and name. It s Pia. Enemy Bullet. Her decides to aid made and good. Make sure he's had or gentleman isn't too Uncle this before creating an object for the bullet. I first had a group here which bill to be for the enemy objects. So I dragged the enemy object Here. Inside this folder, eso create a New York jet called Over the Enemy bullet. And I just find this bright as the enemies will be shooting down from the top. We need to set a poster vertical speed for the bullet so in the pediment I let we spend equals 30. So this is what it would have a speed of 20 because plus job moving downwards, Nobody to make it so damnable it will destroy itself as it reaches beyond the border Monday of the road. So I understand. And here all day you probably know what Just just by now, when the translators 20 because below the bottom, only off the road it destroys it. Nobody to make the enemy ships able to short this bullet. So I'll open nobody enemy on deputy event. I'll make out time a variable inside it to 15 And I don't make this work in the step event here. I have no comment. Named Shoot. You can type two slashes and we're toast article mint and this has no effect on your court . So I'll type shoot here so we know that the court falling this comment is used for the shooting functions and here I have some Good. So it will be Nobody scored, does the time has been reduced by one each step and when it hits zero, we're getting an instance off. Video enemy bullet 16 below the enemy and then we're starting that I moved back to 15. But what is all this? This is the and sign and you can also use Ducky. What ad? In the in its place. But we'll be using these two and science and it seems to combine two conditions. So this is one condition and this is another condition and we have combined these conditions using this and sign So for discord to execute these both of these conditions need to be true. So say if I use or here on the sinews for Orestis Any one of these conditions can be true for this court to be executed. But since we need both of these conditions to be true, I'll be using the ensign. This function ironed, um, returns random. Indeed. Your value from zero upload a value specified. So here in the apprentices, especially to so dysfunction, can return 01 or tow randomly. So here we are taking if that random number is one and if it is, this condition will become true and discord can execute it. We have done just to ensure that the enemy is not always shooting and only has a want our chance of doing so because this condition will only become true and the outcome off dysfunction is one. Now it's time best again. You can see that Danny Means are shooting their bullets. We can also showed them, but it's not even hitting them, and we'll make this work in the next lecture. 8. A7 - Enemy Ships III: header. And in this part we're going to MCD enemies able to be killed. First of all, we need to add some court. Do you mean in its creative and here, randomize. Remember how we were using on and in function to certain at an awards undervalue for this pond enemies mogul. But each time you played a game, do you stand number used for same for the random values to be different each time? You don't know game. You need to use the animals function at the start of your game. So we'll put it in the other. Jimmy in skate event. No, they don't. Let's talk about the lecture, will. You had an explosion. We're done. We should destroy. So when you took your tanks blowing in spite, I'm naming SPR explosion. For this I can a new folder and I recorded defects and I let dass boys it's right here. I said the size to 1 28 by one, don't you? No, period. That's what you know. No, I'm didn't bring that's 1,000,000,000 psychologist. And make sure you send dollar to terminal center. No need to create an object for it. Were first I get a group call effects and can't object inside this, I use a sprite to create explosion effect we need to use. I made variables. So in looking at different and I, he made X killers up with auto size. Off my instance, we're one. Use the default size, so I'm cutting your toe the size between 0.5 animated. My skill is the vertical size off lifters, and I'm setting used to be the same as, ah in magic scale, which is your 0.5? No, I learned of peppermint and he'll die. So each step I'm accusing Die made XK value by zero point your dough and then I'm applying the same changed to image my skill So this will increase The size of diet starts each step and then I lead image all files on oh pastry value off stations. So at one, it's well, it is well and that, dear Oh, it's what invisible. So I'm in greeting it by 0.5 each step, so this will give a fair defected explosion some more cold. So going to this condition when the middle forages zero, which means if it's less than or equal to zero there's a self will be destroyed. Now that we're done with the explosion object will make the enemy object able to explode up on average enemy there to a protest to doing this. So I showed them both here. Approach. One is done using local universe. It's on you guys here where it's like going ahead event and open Napoleon menu here against , like the object I've only been to before since I need nobody enemy to collide with our budget bullet and I ask elected. So as you can see, a new event opens up here, this event will only be executed when the subject clients with any starts off with a bullet . So here I learned some court as you will be. No, this line will clear, Die instance, or with the explosion at the X Y positions off the enemy. This keyboard other is used to refer toa deodorant test that is colliding with an object and it only works inside ugly. An event here, it means an instance off Gabler Dargis colliding with the enemy on it will be destroyed. And after this dubbed anime Istres, air in the garden will be destroyed. So when the collision between a player's bullet on over the enemy happens over, the explosion will be created double, it will be destroyed and talk with the enemy instance will be destroyed. Approach to is done using the step event. So here I had some court. First of all, I had a comment and hair dye so that we know that this part of God is used for collision. And here I had a condition. This condition is the same as using the collision events, and it checks if there's a collision with a certain object at a certain position. So here I'm checking if there's a collision with a bullet and here had some good. So, as you can see, all of this court is the same as views in approach one in its coalition event. But you can see that in the second line instead of using lucky what other? We're using this extensible dysfunction because I told you the other keyboard works only inside a collision event. So hey, we need to know which instances colliding with the object and destroy it. So if this place is the same as police meeting as an ejects, if there's a question with a side, an object at a certain position. But it also does the I d off times chance that's colliding so we can use that I d to destroy it out. Yet using their stance. Destroy function. So deorbit burn. Instance that describing with a budget and it may well be destroyed when decoration happens . No, it's time to get click on play. No controlled the enemies. It's suicide to swing. If you want, you can open your fridge explosion, and you can play with these values to make that's what in last longer or grow bigger as tricking court can help you learn more about it. See you in the next lecture. 9. A8 - Health System: hello there and in this lecture, we're going to make the health put a player. First of all, we need to have a health very able to are clear object. So I'll open. I'll be deeply. The creative meant a lot. We are not creating a health variable, but health is already a building re Evelyn gamemaker. That's why it turns green when you type it. So we understanding it 200 which is the full health. I also create undeliverable and I'll call it Hit and I started to zero. This way we'll tell. But the Doppler has been hit, and if it has disabled collisions for some time now, I need a player to lose health whenever there's a collision with the obedient and we bullet . So I look in the step event and here unnamed this comment. Lose health and he had some good. This function jacks. If there is a collision with nobody enemy bullet and disconnection jacks. If the variable hit is equal to zero. If these conditions are true, health will be reduced by then, and it will be said 2 30 Next we're talking. If the variable hit is greater than zero, which it becomes after colliding with nobody enemy bullet here and if it is good to, then zero reduces it by one. So in the starting, if hit zero the brick and collided with a barge enemy bullet and when it glides in becomes 30. And then again you can not collide with degenerate bullet here because it will not be heard here on this condition will return falls what? It is being reduced by one each step. So after 30 steps, when it again becomes zero, this condition will become true and the player will again be able to lose health. I also needed Dublin ship toe collided with orbit enemy and lose health. So here I lead here. I'm checking if there is a collision with over the enemy and if a difficult video and introduce health by 40 and 32 30. This is very similar to the above court where we are taking the collision with garbage. Enemy bullet. I went to this one, the enemy. So when there's a collision, we need to destroy the other over the enemy distance. So here we're getting the idea off. Nobody enemy instance that is in collision and after getting the I. D. We're using the word function to apply some court. So that instance and in this court reallocating an instance off the explosion at the provisions off nobody enemy chance, and then we're destroying it. So when there's a collision with a B, the enemy, the player will lose 40 health on garbage. Any ministers will be destroyed. We also need to destroy the OPD enemy bird distance when vehicle admitted. So here I lead. You know how destroys the average enemy instance when you glad with it, We needed something similar with garbage Enemy. In the previous lecture, our dear, I learned some more good. So according to this court, when her typical Ozio, which means there W can collide and lose health damage, Alpha will be one, which means it will be fully visible. But if it's no deal, which means it has been hit, the image Alfa will be settled 0.5, which means it will appear faded and transparent. No, we need to draw the algebra, so I let the draw event, and first of all, I'll try, Girl said, because when using the droid went down the folds right off the instance, it's not drawn, so you need to specify it inside the moment that you need to draw its bright. Which window using drugs sell Now let the health barcode. So here I had a comment Newt at the bar and here type. This is the X and my location Where the Hell's Bobby start And this is the X and Y location where the health by will end. So it will start from 16 by 16 in the room and and at 48 by 24 in the room. This is the variable which were using for the health on here. You're using health, you know, object So really was held here. This is the color of the background and I'm starting this to black. This is the color of the health part when the help is low, which we are starting to read. This is the Colorado to help spark when the health is full, which we are starting the green. This is the direction towards which the health bar will be drawn, which we have had in go zero, which means towards the right. This specifies whether that background is done or not, which we don't want to draw Soviet, sending this to force on display advice, whether the border is drawn around the healthcare or note which we need. So I'll said there stood group No, it's tangled Esther game concealer to help the body here. And now, if you collide with the enemy bullets, you say that you lose some help and you become invincible for a second. And now, if you collide with the Virginia minute stances, you can tell you that you lose much health and you destroy them. What if you lose all your help? That has by disappears, and at this point, that play should lose. But it's not happening. So will implement this feature in the next lecture, so you'll dio. 10. A9 - Losing: Hey there! And in this lecture, we make a player able to lose. First of all, we need to get a Sprite for a plea again. Britain. Because when the player loses this, Britain will show up so they can play the game again. So in the Strikes folder I learned another group and I limit G y. And inside this folder I get a sprite SPR play again. I said it size toe 1 98 by 20 Do and I don't know. But I know so type some text here First I was like the color I need protect, which will be black And then I'll click here to get a new earlier for the text. It's like this text toe and look later type No, if I want, I can't like this tool and moved attacked around to send to it. No one had some shadow. So I'll open 94 earlier And in the color Lord Alfa and using the up and settle I would No, I'm done growing psychosis Make sure send our general center No, when you took it and objects for display again wooden So inside Dog Exporter while another group and I learned this to you? I do. Inside this I create an object on name it or B J. Lee again. I lived despite and drag it here. No, I learned the stepping mint on here. Type the function Coalition Meeting jacks. If there is an instance at ablution. So the opposition we're taking here is most X and most white, which is the expert location off the most closer and any is this instance itself. So dysfunction will check if this instance is under the most closer. And if it is, it changes. The next has the size to 1.2. But if it's notable demos, it will change its size back to one. No, we learned some more good here. This function with Jack. If the left most button has been breast and if it has the game really start, we're using this condition inside this one to make sure that the click is owned a button and not anywhere else. No, we need to make the player able to lose. So I love wannabe declare and in its step event on the end, no comment and held type lose. So here we are talking If the hell is equal to or less than zero, which means the health has a zero. And if it has just like over the enemy will create an instance of RPG explosion on decision . Then we're getting an instance off Darby deeply again button at Expo Allocations Room, which divided by two and room I divided by two, which is a center of the room. And then we are destroying my sense. But you can see that in this layer argument. We haven't used their default instances later, but we have used another geo earlier, so we need to open the room and p until you're inside it. Here. I pick on this Martin, get new instance, Leah and a new layer vindicated. Look on it, press f toe and name it GeoEye. So, as you can see, this clear is above the default instances layer. So the plug in Britain that we create inside it will appear on top of the rest of the game , which is inside by Stan Cecilia. I want this room. No, no, it's tangled nest again. Lose some help. Considered a play about destroyed and an explosion. Most creative you can see display again. Wouldn't has we get here in the center of the room and you can click on it to play the game again in the next lecture will implement. Does Korean Visto Syria? 11. A10 - Score System: Hey there and in this lecture will make the score system for a game. First of all, I'm open objects, and I looked over the mean and in its credit mint. I'll start school. Khalil score is a bit invariable. So will you just very able for the score in our game? Next, I'll open the strap even. And inside this island, dysfunction in stars exists checks if an instance off the specified objects exists inside the room, so dysfunction will check. If an instance off of your player is present inside the room and today's it will add one to level your score. So why lovelier is there each step one will be added to a score, and when that player loses and gets destroy, this condition well done falls on the score with stopping reason. Next, I need to draw the score. So I at the drive went and here possible. I said that broke a little black. So what time does that color on a bracket Seiler see black. So this will change that broke a little black, so the text we drove will have a black color. Next, I don't score, so I lose your text This is simple. 16 and 40 is the XML location where this tax will be drawn and this is a text that we don't after India. Some next on this no can only accept strengths, but since score is a number, we'll use a string function to convert it to what strain for use in this motion. Then we learned a string return toe this string. So say if the score is 99 the combined string will be something like this because the score will be added at the end off this text and will appear like this. Next I resend hydro color which decided to black since the default regular is right, I lose Gross said color. And I said It does see right I love money to make it so that you gain points when destroy an enemy ship on lose points by the enemy ship Got some very so I'll open up the enemy on inside it separate here where the enemy can lose by colliding with Deb alert. Here I learned score plus equals 1 50 So when the video any ministers collides with a bullet and losers score will be increased by 1 50 now here When the cheapened destroyed When it gets out of the room here I lied. Score minus three. Close 50. So when this ship gets out of the room, we don't being destroyed. The player will lose 50 points. No need to shoulder player how many points they have gained or lost. So first of all for the game inside the effects folder I paid off again. You know, when you're screened Event I led soils had dalam the road 30 steps on inside alarm zero instance destroy So after being created after the steps this is just got destroyed next in the step of in on Earth So why would be decreased by two each step? So this instance will move apart? No, in the ointment I let so this function will grow This text plus 1 50 and this instance is next on my locations. So this will show that there has gained 1 50 points? No, I think on this object and click on duplicate So I duplicated this object indicated I'll rename this toe really lose So this object will show how many points the player has lost And in the event I let minus 50 send the reformed row. Color is white. We need to set a color for these objects. So first of all, I'll open off again and instrument. I said, Go ahead, go said color. See black and again we said the little white on the end. Andrei, lose Junior scholar. You see that? And again you said like a little white. Let's make decent stances able to immigrated soil open any me and here with the school is increased. So I'm afraid that in stencil what would you again? But I get it inside That juelia so disappears on the door next here went up. Really? Oh, this points I care in this instance. So I'm getting on his tonsils or be they lose in the juelia on the exploration off with your enemy. But I'm using the my location off room height minus 16 because at this point, over the enemy would be belodeau. So if we create distanced us at its my location, it won't be visible. So we're using my location above the border Monday of the room so that it's available. I also create a condition here and at this college races are these two lines of course, so that these two lines of code only execute when object Lee as it inside the room. Now it's time to rest again. You can see the scoring reason here. Short an enemy and you can see that you gain more points. No, let him ship pass and you can see that you lose 50 points. No, who knows? And you can see that the score stops counting. You can see how much school you have may and again you can click complete again and the school to start from zero again in the next letter will make power up school W airship. See you there. 12. A11 - Powerups: header and in this lecture will make two powers for again. The first power will increase the players health, and the 2nd 1 will make Dubler invincible. First we'll draw the sprites for these powers. So inside the spite for their island group, I limit follow. And here I'll get a sprite. SPR held a standard size 22 by Plato under the water up. No. So now I'm done growing it. So close it and said dollars into murder center No of greatness by inside this andan limit SPR I envy foreign instability and said he decides to create job. I heard Wezel Android No, no, I'm done growing goods like low this and sad dog into moral center. No, I could objects 40 powers. So inside objects I learned a group by, well, an air cured object O b j held on design despite no in the creative ent I lad, the spirit equal six. So the vertical speed will be sent to six. So it will move down at this bill. No industry argument here. I learned so this instance would be destroyed and it is below the room. Now I don't click here and click on duplicate. So this objectively we duplicated. I love on it. Aunjanue. Its name Toby, I envy. So this will be the object for the invincibility power. And I feel despite here and the gorge would be the same. No. I need to make the power spoon at random times in the room. So I love one of the main on it. Scared event. I get a variable cold timer vwp, and cut it to 1 50 This little bit of time, we're for abating. Our Barbara objects on disputed will be exchanged for power. No, in the stepleman at the end, I lad. So this will decrease this timer by one each step. So when this time or it is video discord thereon, this is a random condition and being you'll just before If it is true, on distance off aider or video health or a B Y, and be be created because this Jews function to this. Anyone off the items specified inside it spent. It is randomly so it will choose, either or with health or beauty. I agree to respond on this location and after that, that time I will be sent back to 1 50 now I'll call by effects off these parrots inside object Leah. So I'll open it. I don't need step event on the end, I learned. So when there's a collision with the average health, our noble healthy stance that client street up there we destroy and the health will be increased by 25. And here, when there's a question with the average I envy power up which will make the player invincible, it will be destroyed and available. Hit will decide to 1 50 Remember, we used to hit variable before Onda Player would only be able to lose health if it was you . So he s heading hit to 1 50 so that they wouldn't be able to lose health until 1 50 staff later Just five seconds and will become invincible for this time. No, it's time contest again. No word for the problem and you can see when you collect this invincible deeper world up there becomes invincible and can hit enemies anything like this help our up. You can see the health increase in the next lecture will make on the new for again she'll dio 13. A12 - The Menu: Haider and in this lecture will make them a new for again. So first I make a bag on for our menu. So inside the Spirits folder here in the back arms folder, I get a Sprite and nine a mid BK menu. So this will be the background for a menu. I change it. Size 26 40 by 40 Between the science off, our and I would go up that I don't know. Remember that that bag on should also continue Your game started so you can create a background in this layer and use another earlier for that title. So now I'm done doing it. So I love this. No, I need to create another room, which will be for them and you So I don't take on the rooms. Fuller and let create a new room indicated, and I limit room underscore menu just like that back earlier and slugged a new manual beggar and drop it here. I also changed this room size to 6 40 by 40. I will additional, and I'll drag it above this one so that it comes before the main game. No, I need to create a play button so I got inside that geoeye holder and they would SPR play. It was harder to size. Don't go 40 by 80 Andro double. Don't know. No, I'm going during the spray. So I called this and said The origin tutorial center. No, I'll duplicate this pride. Open it and name it SP Awkward. I did it and change the Playtex to quit Michael Distal. No need to create objects for these player in quit parents. So I'll upon objects and that. Do you wife order and I'll just duplicate this play again. But under we created because these new bottles I wouldn't be very similar. And I read and just to objectively and gender sprayed no in the step event where it says Game restart at the game, Children start because it was for the player game button. I attended two room Goto next so that when you click on this button it exudes toe the next room, which is a main game room. So when you were inside that my new room and you quicken disparate, you will be taken to the next room and the game with shot No, I closes on duplicated one more time and gender its name toe a bit acquit. So this will be the quit button And Jane, the sprite now in the room, go to next part, My lad came. And so when you click concrete, the game will end No, only to place a button inside the room. So I'll open room menu on drug. Or would you play here and place it here? And Dragobilje quit and blessed here. No, I'll just a game. No, you concede that this man, you gonna post? There are no buttons here. You're gonna quit the new clothes This? No. I'll open it again if you click on play. No game starts in the next lecture. Willard sounds to again see you there. 14. A13 - Adding Sounds: header. And in this lecture, Willard Sound toe again. I have some sun fires here on the debt stop. So first of all, I'll import this one maintain for the back or music game. So I click on sounds as Let period and I limit Snd under school meal. And now, if you care to select those on file, I would go to Index Top like the folder. It's like this maintain time. And now this on file has been aborted. It's like Well, it is No, I also born the under to salt threats I have there. This one is for Brenda player shoots, and this one is when a few exports. So first of all, I learned to shoot one. So I limit Snd showed and I was like this she would find Did not know I send you explosion for exploiting. Sorry. So first of all, I'll implement this main soundtrack. So for that, I love one of your main anus. Create event here alone, our nuclear sound, which is a function for playing a solemn. Then it's like the sound I have to play. So I was like a sandy mean Then here I can hear the sound priority that is, on a scale of 0 to 10. So here I just at eight. And here we can specify if the sound with Luke or no. Since this is a main back on track, we needed to look so that when it ends, it starts to play again. So here I said True. So, no. When the game starts, the sound will start playing. No, I need to stop all sounds. Tedder playing My game is restarted, so I'll open the room menu. And here in room settings, I was like creation goal. And this is the cold that will run when this room starts. So here I lead. How do you stop? All So this will stop all now you're not displaying. So if you start again the main back on track that is playing the Lord stop. But when they scored runs, it will stop. No, I close this and go this rule. No, I'll implement the shooting zone. Soil upon a video player are in step event. Here is the condition for Children. When your best piece and here we're screwed it. So here I know. How do you play someone? Snd showed and Brower deterred in and look false because we don't want it to do so. It plays only once, and when it stops, it stops. It is again. And now limply went the explosions on the back here in effects. We have a big explosion, and this is used for the explosion of both of Egypt. Clear on w enemy stances. So, in its great event, you hear that I don't place own as a new lawyer And don't look supports. No, I just again the complaint. You can hear the music. No, you can play again. The sound stops. So this is how you live. And sounded terribly. Um, this is the main function. You need out your place. Sound on using dysfunction. You can add any somebody aboard. That's all for this lecture. See you in the next one. 15. A14 - Creating An Executable: header. And in this lecture, I show you how you can build on executable for you again. Nor that you can only do this if you have a board game because you to. Because this is not possible in the free trial version, So does Jack. I'll open options and in Windows, Yeah, I need to gain some sailings. So this will be displaying them off again, which will appear in the title bar and that ask Barbara new SOCOG. So here I limit showed Emma on this is a name or for it's a good this is a file that you run that he actually file that will be used to play it again. So I just name it, show them up with weapons and this is a virgin. So I let this day at one point you and if you want, you can change all the stuff company for the and here, and I may just menu you can change. I call on you again. I'm George ended No, to a career. That's a good table. Go to the build menu and slight clear execute table. Or just use deception. No select packet as it No, I will say this in that. Do you drive And I'll MD is showed Emma. No. It will be saved as a file on the holder will open if you open. Does it find you? Concede that you have excludable there? No, I extracted. So I dont be against, like Mexico. And now I can run this while to play it again. So that's how you below him. If you want to share this game with your friends, you can just give them this file, that's all. And see you in the next section. 16. B1 - Movement with Keyboard and Mouse: header. And in this lecture, I show you how to make clear movement with keyboard and most controls for that I have made a new project. No. First I need to create a place. Right. So I'll get a new spread and unlimited SPR player. Well, then you'd science. Why don't you do? But we do now. We're told a player, nor that the player needs to be from a top down view and the player needs to face, right? No, I'm done doing us bright cycle this and had the origin the Miller Center? No, I could not live up there, so I'll get a BJ player and a sign despite no, I learned the creative in here. Create a variable move. Speed equals tools. So this is a spear with the baby move and available. Just P equals zero and we speak with zero, which are the horizontal speed. And where to go speeded up there? No, I learned those Jap prevent. And here I'll take something put and store it in tow. Just be nbsp variables. So let me explain this line first. Keep your check is a function debtor Dunn's one. When this key expressed so dysfunctional it, and one when right, expressed and dysfunction ability and one when left expressed. And when ducky is not pressed, dysfunction will just return. Zero. So when gnocchi expressed and both of these are zero, this will look like I just be going zero minus zero so it will just become zero. If right expressed, this will be one and this will be zero. So it would look like one minus zero. Which movie won and I just be real become one. If the left keeps breast, this will be one and different video. So it will look like I just be equals. You don't minds one which will become minus one. And if both of the keys are pressed, it will become one way is one and just becomes you so there will be no movement. Now I lose something some love with vsp variable. So this vsp variable will become one ran down, expressed and minus one went up expressed So here we also need to implement that w airs Dickie controls because many people like to use those keys instead of the arrow keys. So hey, I just change the score. So here I've joined the keyboard Tech de function with a keyboard check. Right function using this or so here. This part will it on one. If either off this keys is best either be all right on the same here. This part will return one if either e or left expressed. So I'll do something similar with the VSP line. So here this part, we didn't one if s or down expressed. And this particulate on one if wr up expressed. So now for the movement, both the Iraqis and the Ws tickets should work. No, I'll die. I just be multiplied by smooth speed and we sp multiplied by a move speed. So this will multiply the at ESPN VSV values by the move speed, we just do. And here that expert equals that just be. And why plus equals the S B No, we're done with the movement and over need to make the player feel samels. So here, lad tradition here uses a variable image angle, which is the rotation off the sprite off distance. This is simple. The function point election returns on election value from one point to another, So this is the first point specified with its X and y values, and this is the second point. So in the first point, we have used players X and y values. So this is a police location, and this is the most location, most X and most y. So this really turn in that direction from the player instance Toe the most Gaza and as I need doing May Jungle, which is the rotation, so the parable always fails the mouse. No, we're done quoting the beer. So I'll open the room and put the player here. No, we'll just the game. No, you can see that the player faces the most and you can move using W ergic ease and the Iraqis. So there's a walks as intended. This matter is where useful for making shooters because in shooters, airplane orders needs to face the mouse and shoot at it. That's all for this one and see you in the next lecture 17. B2 - Sprite Animation: hello, DEA. And in this lecture, I'm going to show you how do any major player while moving First of all, I need to animate my sprite So I'll open SPM player and click on Edit Image. Now here you can see on little image on this is a sub image. Currently a spry. It only has one of image and some images are like frames. And I used to any major stride. So do any major sprite. I need to create another frame, but I need to create the frame the same at just one. So I'll need to duplicate it. So I don't like and slowed copy. And here, unvested and other frame has been created. So while animated disobeyed, I'll move these shoulders and make some hand. So for that on first of all areas, these shoulders No, I need to see the previous pride in order to create a new one. So I look here. This is the onion skinning option. And now in this sub image, you can see this one. No, I use a pencil tool. I'll hold control and take this color. And now I'll draw this supplement. No, Now only to create another frame. So I'll copy this one and bitch here. No. Well, again. The shoulders and onion skinning is still on so I can see this sub image here. No, in the sub images, I need to create our transition back to this one. So just I'll turn this onion skinning off and I'll copy this frame and based it and move it to the end. And again, I copied this first frame and I best it and move it to the end. So now you can play it. You can see that place smoothly, but no, only to add more friends. So again, I'll copy this and based it here and in the same way that I made these frames, I'll make more. No, I'm done making this complete animation. I can play and see it. If you want, you can change the animation speed. The default animation speed here is 15 which means that in one second, 15 sub images are player. So I can lower this to 85. But this is too slow. So I gender stood well and this is better. So now we'll go despite. So now that I've made the animation, I need to implement an emission system in that plane object. So I'll open the creative int and first of all, here and I a May speed equal studio in May speed. It's the speed at which despite animates so I'm just setting. It'll zero when this variable is that one, the sprite will animate at its default speed that we said inside that spread later which was set to dwell. But since we're starting you 20 it won't any made at all. And we're starting 80 on create because we don't need the place by to any made unless it's moving, which will go inside the step event. And here I let the animation comment and here I have some court. So here I am, checking if I just be and vsp both article do zero, which means there's no movement at all. It just said that it may speed to zero for the spite will stop animating. And it was said that email in next to zero image index is the subway major we are currently at. So in the Sprite you can see there so many sub images the imagine deck start from zero. So imagine this trio is the first of image. And then a meeting. Next one and so seconds have you made and so on. So here I'm sitting. Imagine next to zero so it will just move this bright. So the first of image? No. Here in the s spot if this condition is not true and there is some movement I was that image speed after one. So despite will start animating now we're done with the object. So it's time to digest. You can say that a player is not animating why it's not moving and start moving and you can see that the emission starts and show up again. You can see the animation tops, that's all and see you in our next lecture. 18. B3 - Collisions: header and in this lecture we're going to make basic collisions. First of all, I need to create a collision object. So for that I will first create a Sprite SPR collision. I said It's science. Do but they do. I love to do and here I feel it with the color. I use purple. You can use any color you want on a level. Click on this layer on Lower Sebastian so that value in the room you can see what's beneath this object. No, it closes, and I won't change the origin. I needed to be at top left and select all of this. Now you create an object for this soil grade or B J collision. I designed this bright. I won't add any court inside this object. I'll implement the collisions in tow. A video player, I look on it and in its chapel mint here we're just be is added into X. Before this line, I learned some court. So this condition here checks if there is a collision, but object collision at X plus just be and why? Why is just the vertical position off the object? But here in X, we have added that just be so. Collectively this becomes a position with a player is going to move so it checks if there's a collision with object collision where the player is going to move horizontally. And if it is, it sets the horizontal speed to zero so that it stops moving now. Similarly, before this y plus equals we SP called I learned some good So this condition is similar, you can see But here we are not adding any way ableto x. But why? And here we're adding we eSpeed away. So this is a very copulation with a player is going to move. And if there's a collision with object collision where the player is going to move vertically, the vertical speed is Satya Leo so that a player stops moving. We are done with the collision court. So now I need to place the object collision objects into the room so I'll open it. No if I want to please the object collision instances here I can just track and place them here. Or I can just click here, hold older my keyboard and use my mouse to play Zion stances. This is much easier. You can see that I am able to easily place die stances because my great settings the great X and goodbye are the same as the size off the audience. Right? But if you're questions, pride sizes different, say 64 64 or 16 by 16. Just make the genius in this great settings and it would look friendly. My spite Souto. But for you, too, on the Greek headings, Trade to better you do as well. So it's working fine. No, I'll play some more. Intense is here and no one just like him. No, you can move. And if you go goes to these instances, you can see that the player stops moving. But sometimes while moving, you can see that the player got stuck in the ball to solve this problem. Clauses and I look on the player object, and here you can see that we are changing the objects image angle so that it or dates. But the problem is that when you rotate doing stunts, the question mosque off diet stance rotates as well, and when it rotates, it gets stuck in the ball. So for that I stop using this image angle very ever, and I get another variable here, gold just angle. This is my own valuable and notable didn't want. And in its place I lose the angle. Agreeable? No, I'll use this angry able to rotate the sprite just despite northwards collision mosque. So the question mosque will stay there and the player will stop getting struck in the board . So for that, I'll open that going and and here I, like, goes right. He x do so. This is the extended version off the coast, right function, and you have much more arguments here. So here I let spite index for the Sprite. Imagine decks for the sub image, X and Y for the location and for X killing. Why skill? I just used building in magic skill on He made vice good variables. And here in the rotation argument, I'll use angle so that every able that I made is used for a dating the sprite and in the color as Add image plant, which is the building variable for the color of the sprite. And, you know, I thought, I just use image Alfa so district solve our problem off the player getting struck in the level. So I dusted No. And right now you can see that that were never great stuck in the world. That's all for this lecture and see you in the next one. 19. B4 - Tiles and Autotiling: India. And in this lecture I'm going to show you how to make tiles and use the order routing system off gamemaker Giulio too. First of all, I need to create a diet sprite for that. Inside this bites folder I learned a group and I limit highest bites here. I'm gas bite and I limit spr de l Land Verity. L stands for time. I want my tiles toe Haven't really do but very to size. And I won't despite she to contain it by eight eyes. So I'll send the size to 20 to modify it. We just have to fix islander despite No. And here I'll be care to Don't own the bread. And here changed a great size. Totally do. But I do. Which is a science over tiles? No, I can draw the times here. Keep in mind that you can draw a tile hair in the first block. So you need to start from here for a start. I drew a grass block What I want right here. But here because later on I will draw the borders off this grass. Look on on here. So I started by using the filled rectangle toe and selecting the screen color. And I don't make this grass time here. No, of course I have to do a lot more tiles, but I come back to this later. First of all, I need to create a dial set using us right and dust created. So I click on the title Sex folder and Select Cleared. So this will create a new Doyle said. And I limit d L under school and and I'll drop this bright sheet here and here in a little bit and I'll height. Make sure you type in the size off the tiles you want. Say, it's my diet that how you doing, what you do agendas. Now I place this graph style inside the room. So I looked in the room and here in the lira section on If you care new Tyler, so desiccated a new layer which should be used for tiles only. And here, in this right panel against, like that, I said, I want to use So I was like, Dear land. And here you can see all the times you have, since I only have one tile hair, which is the graph style selected using the most no. Here in the room, you can place the dials by clicking. You also have a lot more tools here. The pencil tool is a tool felt toe and line two and shape tools and so on. Since I need to fill the room with the gas look, I'll use the felt ill here on Click in the Room. I won't this time leer Tobey under all day stances, so I'll drag the style and moving under nine status layer. Now I need to create more days so far to close this room and open SPR. Dear land No, here, under all the Boehner's off this glass time and fill half of this area with gas and the rest with water. So first I need to know where the centers all the files are. So for that Jane, the great size to 16 by 16. Now I use control to select this grass color and you disentangle toe to fill this area with grass. No, I select a blue color and use other tangled good the rest of the year with border. Now you can gender size back to try to do what I do and see desire dials. No I do something similar with the next three, but he grid. But here I feel that's interpret border and feel helpful to say, having voted like a need, hair with grass and then here been arrested. There you have a grass, like I did here with water. So I'll grant that water dial here and again. Jane Doe good size to 16 by 16. And fill half of this area with water and then fail. Rest of there you have it. Grass? No, I need to create to mow tiles here. Where? The grass and water into set diagonally. So here I fell. These two tiles with king color and beard somewhere else. Here. Nexus like the blue collar off water. And here in the first trial, I'll fill these two blocks with water. And here in the second trial, I'll fill these two blocks with water. Now, you can Gina size back to do what I do and see that your tiles already, But these are very basic, so I'll tweak them a bit to make them look better. No, I'm done with this, so I love this right now. You can see your diess inside the mindset, dear land, Nobody to make order telling work. So I click here on styling and this new window will open. I've looked here to our does 15 does that And here you can see a template off tiles. Here. The white part is glass and a great but is water. So select your ties according you. First of all, this is fully white, which means grass. So it's lovely inside. No, here you have grass here and you have water in the top left corner. So this is a light that corresponds well with this and similarly has left on the dials. Now I have selected all the tiles or daughter dialing system. If you want to see that template, you can click here and you can see the times course born well. The grass is the white but and the rafters water now already toe do is place these ties inside the room. So I looked in the room and click on Otylia here in the tools. I was like this on the title and now I can right click where I want water and left click. We have what, Russ, you can see that it works very well. No one else do is open. The stance is clear and let the first vehicle engine stance and then go all the way down, hold shift on the keyboard and slept this last collision chance. Now all of the proletarian stances will be selected, so I'll click here in the room and rest do you don't look, he would, and these instances will rebuke it. Now I look on that, Tyler, and using the auto dial, I race water inside the room. No, I look with nine stances, Leo. And here I'll open Are you saw this job and in the objects reflect of ejaculation on using old and most I'll place new dances here. Now all I need to do is open over the collision here and untech this visible option so that it won't be visible inside the game. So now I'll just the game. You can see that a player can go near water. This is because off the agenda stances, But they're invisible. So you can't see them inside the game now only to make a little addition to Rodiles. So I close his room first and I'll open that. That's right here. A new did don't on the great And here, andro lovers. No, I'm done doing it. So I called this bright and open the room here. Have you cornered ice layer and click here to create another earlier on. This will be for the flower. Katie. No. Here it's like the dial set and I select the flowers child. And now I can place it. Really What I want. This way you can create many more tiles. No, I'll just a game. You can see that The scene looks a lot better now. Now try to create our own tiles and I'll see you in the next lecture. 20. B5 - Camera System: hello there. And in this lecture, I'm going to show you how to set up a camera in your game. A camera is used to show a part of the room, so say, if you have a big room, camera can be used to follow the player and only show the part of the room that is around it. To set up the camera, you first need to create a background objects that appear in the camera. So here I first created over Jemaine. Inside this, I had a few different and here types in court. First of all, I need to enable views. Views are worth the cameras used to show the part of the room. So first of all, I view Enabled equals group so desperately enabled abuse. And now I'll type you busy but square brackets geo because true so this will make the first view visible, which is the view zero, and it's 34 view off the room. Next I create some local variables. This height is the height of the camera view. Disparate is a bit of the camera view, and this is a scale of the window. So if the bit off the camera view is 6 40 Dab it off. The window will be set to 12. 80 with the 6 40 will be played by the scale, which is to. So if you said this to one dove in Dover, it will just be 6 40 But that would be too small. Soviet setting. This came toe No. Okay. In the camera, I stored up your camera in a local label called Camp. Next I use a function to be in the camera with this camera and the scope. Create underscore view Here. This is a place where the camera is created inside the room. So I'm just setting this 200 This is the bit. And this is the height on the camera. So I'm just sitting deep to the labels like we did before. This is a traditional the camera, and I don't want it to be to read it, So I just set it to zero. This is a subject the camera will follow. So I'm tending the store video player so that the camera, but for a player, these are the maximum speeds off the camera, and I'm just setting them to minus one. So there's just no limit. And these are the maximum horizontal and vertical distances between the player object and the edges of the camera. So I am just starting them to a bridge divided by two. And Heidi went where? Toe So that w stays in the center off camera. No, I don't like the camera to love you. So I lose view said camera. And here time of you number, which is zero and here type of camera variable, which is camp now I need to resize the window. So I died window side size and here I said, writ into scale and height into scale so that the size of the window is set according to the scale. Next, I need to resize that game surface. Our surface is basically canvas, very game is drawn, So the main surface off a game is application surface. So I decided that one he was in surface you size application surface written to scale and hide in the scale. No, I look in the room that place over you made inside you in our just again. No, you can only see a part of the room and the camera follows were with a player cause that's all for this lecture. And I'll see you in the next one 21. B6 - Draw GUI (Tip): hello there. And this lecture is a useful tip for people using cameras or use. Let me explain by showing an example. So I first hoping that Jimmy so say I have to draw the score. So for that I'll open the driver and here type Go Dex and location five by five and some text. So as you might have guessed, this mineral that score at revision, flight by fight, but that will not work as Internet. If you're using cameras or views, you can see this by starting the game. You can see that that score doesn't appear anywhere, but if you go to the top left of the room, you can see that the school is there. So the problem here is that the driver intros the text and looking him, fight my fight inside the room. But what we need to do is draw the text on the game window and not inside the room. So for deck, I'm just Jane this event to draw GeoEye, so this should work. The difference between the normal driving and the road you event is that in the drive it all the X and Y locations are inside the room. But in the Poggio argument, all the allegations are on the game window. So here, when I die five by five, this means that it will draw the text at the location, fight by five on the game window and not inside the room. So you can see this burning the game that the text appears here. So they should be useful for creating hard in your game. Notice oil and I'll see you in the next lecture.