Game Maker Adventure: Part 1 | Jennifer Lucas | Skillshare

Game Maker Adventure: Part 1

Jennifer Lucas

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
7 Lessons (27m)
    • 1. Introduction

      0:25
    • 2. Preparing Your Assets

      2:46
    • 3. Creating a Walking Character

      5:30
    • 4. Creating an Obstacle: Asset preparation

      3:40
    • 5. Creating an Obstacle: Solid Objects

      4:45
    • 6. Backgrounds and Rooms

      4:21
    • 7. Warping Between Rooms

      5:09

About This Class

Game Maker Professional recently sold over 200,000 copies on Humble Bundle, but the free version will be enough to get started in this set of tutorials.

This is the first in a series of classes on creating an adventure game. This class will cover creating a walking character, solid obstacles, and movement within and between rooms.

Assets are provided in the Class Project.

Transcripts

1. Introduction: In this series, I'll be covering the creation of an adventure game using gamemaker studio. This first class includes creating a walking character, solid obstacles from to maneuver around and traveling between rooms. A free version of gamemaker can be installed through steam. 2. Preparing Your Assets: Okay, So our first step will always be preparing your assets. I have one folder here where I've got my good friend Captain Walk cycle that I made using gimp, a little animation, a footstep sound that I found on a free sound dot organ and trimmed using audacity Free programs that are very slow. And I've got the bulls in game makers commits folder and I'm going to launch the CEO through Steve. Click. Do this one skill share. Adventurer faked. Okay. First, we will bring in our sprite. Right click on the sprites holder over here. Let's let's create. I will name it P R. Captain. A lot of people put underscores in here. I just don't like to. That's up to you. Load Sprite. I just hit back. I can find my folder here kept in lock cycle open, and it's given him a solid background. So I'm going to hit and it's braked image. Erase it color and it automatically selects that background image. And I can increase or decrease the tolerance about there and would change his origin to the center. Yeah, that looks good. Okay. And we've also got our footsteps sound. Uh, but still open. Still share footstep and I'll hit injured. Okay, and that's it. We have all of our assets loaded and ready to go. 3. Creating a Walking Character: Okay, We have all of our assets ready and we can start creating. Are walking character going to right? Click on objects and slipped. Create object. I will name this O B. J. Sprite is our captain's right. I'm going to check persistent so that he'll move across rooms, but not solid. And now we need to add events. So first we will add our create event. So what this means is when he is created So at the start of our game, these are the actions that will be completed first. We have a few variables that we want to change. One is image speed zero, because when he first comes into being, he's not moving through the reason for him to be animating as if he's walking. I'll go ahead and add Image index to zero so that he looks like he's just standing still. And he's not in the middle of a step an event keyboard left, which means whenever you hit the left arrow key on your keyboard, we want him to move, uh, for my captain and the footsteps sound speed that I've used. It would be negative. 10 on the X axis. Make sure you check relative. If you're using your own animation or sound, you won't have to play with these and find out which numbers work. Best your own game. But if you're just playing captain, then negative 10 and we also want it to look like he's facing left and like he's walking. So we'll do image next scale to negative one. And that just flips his image on the X scales that was facing left and village speed. And I will set this to 0.25 and, yeah, that's all that he needs to do to walk left. So I'll duplicate this for right and just change this to a positive value and change this to a positive one. And it's pretty much the same thing for up, except there's no reason to flip this, so I'll just delete it. And he needs to move on the Y scale in the negative direction. I think it looks a little better for him to move a bit slower on the up and down just for this isometric view that we're using. So I said that to negative five instead of 10 and duplicate that four down arrow and said that to a positive five. He also needs key release events. So I'll go to add event. He release left. And I'm just going to copy the actions over from my create event because we want him to do the same thing. We want him to stop and mating and go back to Hiss first frame if you let go of the arrow keys, so I will duplicate this for all of the keys. And that's that. The only other thing he needs is to play sounds when he is walking, I'm going to make a sound check that is under main one. You want to check? Sound it sound. Footsteps is not playing and he's moving. Then play sound footstep and to not lose. So we'll copy this little if statement and put it on all of his movements. It doesn't really matter where it goes. There we go. It's now we're going to make a room, right. Click on create and right click on rooms likely create room. Go over to your objects town. He's your only objects that will be selected, and you'll put an instance of Captain Walk cycle right there or wherever. Doesn't really matter as long as it's inside the room. Grid check and played dust. Right. Left down, down. We have a walking man for captain. Suppose captain is gender neutral. Catherine walks me whatever you want them to be. That's that. Not very much to do in here, though, so we should add some obstacles. 4. Creating an Obstacle: Asset preparation: for our next step, I would like to encourage you to create your own sprites for your terrain obstacles. I painted mine in gimp, and as you can see, I'm not any kind of master artist. But if you would like some advice, I would say Get familiar with the layers window very early. Use only transparent layers and use a lot of them making a new layer before you paint in a different color or a texture can really help with your comfort. Level is you experiment with different techniques. Also, adjusting the opacity of your layers can help can help blend the colors in your image together. For this example, I will be using three different obstacles. Sprites. So pause now to prepare a least two. Okay, I have added my obstacle sprites to my project folder here and now I'm going to add them in game maker. Right click create Sprite PR bushes loads, right. You do So my nice, transparent bushes that I put together in gimp going to modify the mask so that only manual on the bounding box so that only the bottom of the bush will be solid slipped there just like that okay. And I'm going to move my origin to the center bottom. That my height here. So that would be 1 43 by 87. Bottom center will be the origin of my bushes. And I've got a couple more than I'm gonna Adam and add my sprite for rock. It's pretty terrible. My mask to bottom. I'm doing this because I want these two objects to be ones that Captain can walk behind and in front of and round with our little isometric view that we're using center bottom for the origin. And I'll need to modify the captain's masked as well. I like to use about me down and not a lot of buffer around his leg, but a little bit below the foot. And now I'm gonna make one more PR Bush. It's fright. Bush won still transparent. I'm going to leave the bounding box a little bigger on this one. I'm gonna still modify it, but I want list be used, create my vertical borders on the sides of my rooms. So I'm going to make it a little bit a little bit bigger of a box. What is the origin center on that one? 5. Creating an Obstacle: Solid Objects: it's now that we have those rights. They need their own object data object Bush is. Bush is solid but not persistent, and it means a create event of its own. And that will be control tab to the variables action. And we need to sit deck to negative walk. So that means, whatever their why value is in the room, the inverse of that will be their depth. And the way depth works in the game maker engine is the lower, the value, the closer to the viewer. It ISS. So we want that quit coffee, copy that action. And since we want the captain to be able to walk around these objects, his depth is going to need to change as well. So I will paste this into his create event and also into his up and down movement events, and that will make a few more objects for my other obstacles. I've got rock solid free event depth, almost got to set the Sprite there in my bush, my individual Bush, Bush, right solid, create imminent death, actually going to move captain's origin to He's looked just like that right in the middle. Let's see center is 40 to put it on his foot at 40. There we go. We needed to be in the middle so that when he flips, he's not jumping several steps to the left and right. When his image flips, Captain needs collision checks on his movement. So I put a new question, which is under the control tab. Questions check. Empty, but that top and let's see, this is moving left. So we need to check position Negative 10 on the X axis Relative. Captain, we are only checking for solid objects Now. We want this to apply to everything else that happens. So we go to the other box and we add lock arrows on either side that this and taste it to all of his other movements and just change. Check location two of the jump position. Yeah, right. And there Positive on the Okay. So let's throw a few of those into my room. The same plane, mostly unedited room with my objects tab down here. See Object ad with left mouse optic captain. Change that to let's put in some bushes. That's in a rock. Just a little bit of overlapping over here like that in my solid Bush border over there. All right, let's check this out so Captain can walk in front of them, not through them. And this bush over here can't get close to or walk through because it's there to barricade him. Some leaving level. But these little close together they look funny, their looks All right. So there's Captain and Winrock. 6. Backgrounds and Rooms: before you start creating or selecting your backgrounds, decide on the dimensions of your game window. Mine will be 1400 by 10. 50. Both of my backgrounds feel the full height of the window. I made one that was only 700 pixels across and is capable of repeating horizontally. My second background is twice the width of my screen. As I'm planning on having the camera pan with character movement. Prepare it. Leased to backgrounds before the next step. All right, I've got my two backgrounds in my folder. I'm going, Going gamemaker backgrounds. Right. Click Create all this one Bress. Sure, why not? Soft background tile. Horizontal. Okay, a second round kg. Some sick Johnson has grasped, but whatever. Okay, start with our first room. Go over to the backgrounds. Select. Did you grass? Go back to settings. I will set this to 2800 10. 50. No thes things down here. No, they're not flying in the sky. Okay, then we need a view. Enable use of use. Visible one room starts. Make it half the width of the room 1400 by 10. Which means it needs to be weighed the camera to be following our captain. I'm gonna give it a that's horizontal border there of 300 pixels. So he's got a good buffer before he hits the side of the room. Oh, right to a second room to same dimensions. 2800 by 10. 50. Background. Since it use same as before, 1400 by 10. 50 and again and still following the captain with 300 pixel buffer on the side. I don't need to Oh, okay. I'm just gonna go ahead and fill in this room, you know, with the borders bushes alongside. Some of them could be flipped. Just make it look less like I'm doing the same thing a bunch of times. Okay, so now we have this room, captain can walk around camera scrolls within. Can't just been to this guy. When reaches the end of the best is not going where up next. We need to make more panels to bring him to the next room. 7. Warping Between Rooms: Okay. I have one additional sprite, which is my work spread. Let's add that in. Right click creates great our work. Lo What? There we go. I will add an object. Work Sprite warp way Will uncheck visible. Okay, Now we need to add a collision event with the captain. And here is where we will add your first bit of scripts to go to the control tab. Select execute code. We were right. Very simple. Uh, whatever the name of your character object is in my case. Oh, J Captain Capitalization is absolutely important in this. You have to get it right for nothing over. So Oh, BJ Captain, that X equals target Fix will be Jake, captain dot Why equals target? Why? And grew underlying go to and in parentheses. Target are you need to put semi Coghlan's at the end of every line. That's how it knows that it is the end of the line in this particular programming language . Don't forget how you spelled or capitalized any of these variables. Target X target. Why? Target are? They don't have to be exactly what I used. But you have to put exactly the same thing in our next A little piece of code. Is it okay here we will open both of our rooms fruit of our exit objects and pick war. So the wind reason we did not select visible when we were making our warp object Because it only has a sprite for us. And we do not want a big yellow box that says warp to show up in our game. So we need to put in values for those variables we created, right click on your warp and select creation code. This will run when this particular instance of war is created So you could have individual values for each instance in this case, target X target. Why? And target our target Are will be the name of your second room. In my case, it's just room to target X will be the X value where you want the origin of your character land. Say right about here Which in this room is 1 92 on let's say 800 for the why semicolons at the end and hit check. Now we need one in our other rooms. Object work right here. Creation code X equals say, back here on a path about there? 25 92. Chemical target. Why equals 7 24 Target R equals room one. All right, now, I'm just going to do swick decoration in room two. All right. Finished decorating my second room. Let's test out our wars. All right, there he is at sunset. Okay? Can we go back to our brother fast? Yes, we can. So that's it. And we've got two rooms. You could walk between them. That's a little bit boring up. Next, we will make some interactive items, starting with an inventory system.