Gw Temp

Menu

Article - 'Making the jump to Game Maker II' by Guest

An item about Miscellanious posted on Aug 9, 2003

Blurb

Second part in Kuro's article concerning making the move to using a more advanced game creation tool!

Body

Making the Jump to Game Maker: Chapter II

Introduction

I’m finally giving back to the community after all the resources and bandwith I’ve taken. I also hope that these tutorials will keep me out of hell. I’d like to thank God almighty, for his guidance and spiritual… stuff. Don’t forget Jesus too. He’s my homey. Ok, offended yet? I apologize. Now let’s get our hands dirty.


Lesson 3: Objects continued…

If you read and followed the last tutorial, you should have a shiny new sprite itchin to be seen. Today we’ll be able to show and move your sprite on the screen and stuff. Please keep in mind that we’re not making a full-fledged rpg just yet. We need to get these basics down before making towns, battles (the best part), and super-cool secret characters. Continuing on, I’ll start this lesson by asking you to do the following:

1. Open the mjgL1.gmd. If you didn’t do the earlier tutorial, go do so now, or make your own sprites. Don’t know how? Read the freaking tutorial!
2. Navigate to the Objects folder, right-click, and choose ‘add object’.
3. When the Object Properties window pops up, change the name to the name of your sprite.
4. Smack your monitor on the side to calibrate the object’s settings.


Okay, if you completed 1-3 successfully, you’re in the clear. If you actually DID #4, I pray for your soul. Now it is time to get your sprite. Click the small button next the ‘’ textbox and click on your forward walking sprite. Nothing will happen just yet, but don’t worry, its set. Make sure the ‘solid’ checkbox is unchecked, and the ‘visible’ checkbox is checked. Click the ‘OK’ button to save your stuff. Congrats! You created your first object! Now you want to see it in action eh?


Lesson 4: Rooms (a.k.a. Painful Realizations)

Heh, ignore the title for now. You want to see your sprite in action so what do you care! Simply put, a room is the equivalent to a map in Game Maker. It has all the functions of a map, but only better. Don’t wet your pants yet, because I haven’t told you the best part yet. The rooms in Game Maker are so advanced that you can create MULTIPLE parallax backgrounds! No more using pictures to simulate hovering clouds! Okay wet your pants, clean yourself up, and get ready to learn.

To create a room, do the same thing you’ve been doing for everything else. Right-click the Rooms folder and choose ‘Add Room’. Up jumps the Room Props. Now look at the screen for about ten seconds. Study it very carefully and look at every button, slider and tab. Make sure to pay close attention to the tabs, because they’re important. When you’re done, execute the following instructions:

1. Maximize the Room Props window so you have a better view of things.
2. Click the ‘Settings’ tab.
3. Change the name of the room to ‘Super Doodz’.
4. Or change it to whatever you want…
5. Don’t set a caption.
6. Leave the Width and Height the same for now.
7. The speed is important. If you remember back in the sprite tutorial, I mentioned the speed affecting the sprite. Here’s where you can change it. It’s set to thirty now (Game Maker’s default) so leave it the same too.
8. Don’t check the persistent checkbox.
9. I suggest you click the Creation Code button, just to see what it looks like. This is basically what you’ll be typing code in, but don’t type any yet. Close that window and continue on.
10. Last step. Make sure the Snap X = 16 and Snap Y = 16. We haven’t explored tiles yet so don’t trouble yourself over it.


Even though the background is a dull gray, that’s not important. We need to get that object in the Room. Click the ‘Object’ tab and look down at the bottom. Click the funky button and find your object. Finally click somewhere on the screen to place the object. Oogashaka!!! Your object is ready to go! Before you can go preview it, we need to fix up the screen settings. Time to check the game options.

Lesson 5: Game Options

Aha, finally something new. Double-Click the ‘Game Options’ on the sidebar to open the window. Study the screen and try to understand as much as possible. When you feel you’ve filled your brain with knowledge, complete the following steps:

1. Smack your monitor to calibrate your settings and click ‘OK’ to save the settings.
2. Seriously, click the ‘Start in full-screen’ checkbox.
3. Leave the scaling settings alone.
4. Click the ‘Set Resolution’ checkbox and look at the following options.

Universally, most people don’t use 640x480 pixels anymore, except for schools that are too cheap to upgrade the crappy Compaq computers that sit in the Math Labs and lock up on you when you try to open ANY file. Sorry getting off on a tangent. You should run this test game in 800x600 16bit color with the default screen refresh rate. The rest of the check boxes should be unchecked except for ‘Wait for a Vertical Blank’ and ‘Display the Cursor’. Now click ‘OK’ and save the file as mjgL2.gmd. Its time to test the game.


Lesson 6: Events In-Depth

To test what you’ve done, click the green arrow on the menu bar. What you’ll witness next will astound you. Your sprite is a midget and you cannot move him. Pound the keys all you want, he won’t budge. Smack yourself if you pounded the keyboard and hit the Esc key. We’re going to add some events to the object so we can move your sprite.

Events are well… events. The user does something and the event executes. Events range from keyboard and joystick input to reactions to variables and system tasks. Compared to Rm2k, the events are very much different because they allow much more freedom to do whatever you want. There are very few constraints in Game Maker which allow it to be so flexible, it can bend backwards and still be able to stand up straight.

Yeah that metaphor sucked. So what? The point is that we’re going to use the keyboard events to move your object around the screen. Lets get to programming!

Lesson 6.5: Events and Actions

Getting tired yet? I know I’m tired of typing this. So I’m going to start using pictures to explain this stuff. Let’s look at the following. It will explain how to add an event. (Bear in mind that the picture is from another one of my games. It will still explain what you need to know.)

By pressing the ‘Add Event’ button, we’ll get the resulting dialog box. As you can see, it displays some similarities to Rm2k. For now, just click the keyboard button once to pull up yet another tab. Choose the option and behold! You’ve created your first event. Now to put some actions into it. Start by studying the tabs to the right. They contain Game Maker’s drag and drop actions. (a.k.a. The icons) They’re very extensive but very easy to learn. You can learn them all by yourself if you want, just by playing around a bit. But for the purpose of this tutorial, we won’t learn what they all do. All I want you to do is the following:

1. Click the ‘Objects’ tab.
2. Drag the ‘Change Sprite’ icon onto the actions frame. (hover over the icons to see what their name is)
3. When the Change Sprite Dialog comes up, press the small button next to the sprite box, and find the sprite for walking left.
4. Leave the scale factor alone (it obviously scales your sprite by nx, where n is the number you put in, and x being the multiplier (i.e. 2x, 3x, 4x)
5. Click OK.
6. Now click the ‘Move’ tab.
7. Drag the Horizontal Speed icon into the actions window.
8. Now set the Horizontal Speed to –6
9. Click ‘OK’

Now you’ve created a full event. You da man (or woman)! Go ahead and test your game! If you push the left arrow, your sprite should change and start walking left! But he/she won’t stop. Ever. So hit ‘Esc’ and get your object window open again. We’re still a ways off from getting it to work.

Lesson 7: Finally, We’re done! What? We’re not?!!

Damn this is taking forever. But from here, you should get it quite quickly. To set up the other walking keys, all you need to do is Add Events for each keyboard direction, and add the right actions for each. So instead of me holding your hand, I’m going to explain which icons you’ll need to use.

1. Add each sprite (Change Sprite) according to the correct keyboard event. (i.e. The Up Walk position for the Up Keyboard event)
2. Add the correct movement icon and set the correct speed. (Vertical Speed is for up and down, while Horizontal Speed moves left and right.) (NOTE: negative numbers move sprites left and up, while positive numbers move right and down.)


After completing all of that, you can test your sprite once more. You can move in all different directions, but you still won’t be able to stop. Time to fix that, and finish off this chapter.

1. There is a ‘Key Release’ event in the ‘Add Event’ button. It should explain itself so I don’t want to go over it.
2. Choose whichever Key Press you want to work on.
3. Now all you need to do is drag on the corresponding Speed Action (Horizontal Speed, Vertical Speed) and set it to Zero. Do this for all four directions.
4. If you don’t understand, take a look at the following pictures.





Test your character once more and you can clearly see that he/she stops whenever you let go of the key. Very cool, right? Wrong. I’ve taught you the basic way of moving a sprite, but its not the best way to do so. You’ve just painfully realized you’ve wasted your time and you want to kill me.



Just kidding.

Okay, the only problem right now with the sprite is that he/she is walking in place. Easily fixed, but not today. The tutorial itself has been going on for a while and it needs to stop. So with that save your game as mjgL2.gmd and shutdown Game Maker. I’m sure there are a lot of loose ends I left open in the tutorial, so instead of fixing them, how about you leave a comment if you find one. That way, the ones who actually read the entire thing thoroughly will understand it. Any questions? Email me at krealm2k@yahoo.com

Thanks for reading, and remember to praise Jesus. He really gets a kick out of it.

-Kuro-