Monday, May 25, 2009

Tuesday May 26: first day working with Gamemaker

OK, to start this week right, we are going to begin using a program called GameMaker. It allows you to make some simple yet compelling side scrolling computer games without knowing any code. The first step is to install the program, which is included on the CD I have passed around. Also included are a sample game I have made, along with some picture files



OK, so here's what you do after you install the program



turn on the program

stay in simple NOT advanced mode

dont upgrade (obviously)




the first thing to do is add a room. Rooms are like levels,its where the action takes placeto do this click on RESOURCES at top of screen, then click on "Create Room" This will create a room called "Room0"
your room will have three tabs. Click on the "Backgrounds" tab to change the background color
run your program to see if your room works by hitting the little green arrow at the top of the program
The next thing to do is to add some "sprites" that you will use in creating objects. Sprites are picture files, while Objects are things that exist inside your program. Some objects use more than one sprite, but most use only one. You'll see why in a little bit! But first, lets add those sprites:
click on RESOURCES at top of screen, then click on "Create Sprite" the next step is to give your sprite a name. Name this first sprite "PacLeft"then clcik the LOAD SPRITE button, goto the folder I have given you and choose the "PacLeft" image file. Then, Click OK
Repeat this process three more times, adding Sprites that are named PacRight, PacUp, PacDown. Use the other Pacman Images that are available...its easy to figure it out! You can also add any other sprites you like, just make sure to name 'em so you remember what the heck they are!
The next step is to create an object. In most games, the first object you create is the main character, the one that you make run around and do stuff. So lets start with that:click on RESOURCES at top of screen, then click on "Create Object"
Name your Object "PACMAN" and then, assign it a sprite. To give your object a sprite, click the little blue button right next to the word "sprite1", then choose one of the Pacman sprites you've already loaded. I chose PacRight, but thats just me
Once you've done that, its time to add your object to your room. You do this by clicking the "objects" tab on your room, then go down to the bottom left where you see the word "undefined", clcik the little blue button right next to it, then choose PACMAN.
Then, click somewhere in your room to add your object. Run the program to make sure it works!
Crap, he doesn't move! Hmmm... we'll have to change that! Right click on your PACMAN object, then click Properties.
Next, we will add an event and an action that happens because of the event.The first action we want is to make our Pacman move, and the best event for that is a keyboard event.SO, click on the "ADD EVENT" button, then click KEYBOARD, then choose
Now let's make something happen when we hit that key: an action. At the top right right, you will see a button that looks like eight red arrows pointing in eight different directions. Drag that into the ACTION window
A little dialog pops up... click the word "object" then choose the Pacman object from the listClick the arrow thats pointing right, then set a speed of 3CHECK the "relative" check box, then click OK
BEFORE YOU DO ANYTHING ELSE, we are going to add an action for what happens when you are not pushing a key...otherwise, your pacman will just fly off the edge of the screenclick on the "ADD EVENT" button, then click KEYBOARD, then choose For the action, choose that same eight headed red thingmabob and drag it into the Actions windowchoose the PacMan object, then click the dot in the center of all the arrows. Set the speed to "0", and check the "relative" box, then click OK
Now, run your program and see what you get
Your final challenge for today is to make your PacMan move in all four directions
Cheers,Mr. L

No comments:

Post a Comment