Gw Temp


Article - 'Introduction to Game Maker and Sprites' by Terin

An item about Graphics/Audio posted on Aug 9, 2003


Part I of my unofficial "Gamemaker Week."


So, I'm sitting here with everyone telling me that RPGMaker sucks. Not that many people use Game Maker, and I'm a little curious to know why. I've never used Game Maker before (but I have programmed things, and I do think of things through the Programmatic Process) Of course, that helps me out quite a bit, because complex tasks are broken down into little, easy things.

If you've never used Game Maker before, it's a lot like Visual Studios (Microsoft) and RPGMaker mixed together. You have a neat little folder-view on the side that contains all of your 'objects' to work with. The interface at the top is sort of like RPGMaker as well. You can start and stop your game (kind of like Visual Studio) and add stuff with the buttons.

Looking at it on first glance, it's pretty simple. It's divided into nine sections:
Sprites - the graphics we use for characters/enemies.
Sounds - what we'll hear in the game.
Backgrounds - tiles and panoramas possibly?
Paths - probably how monsters/NPC's walk.
Scripts - like common events -- the stuff we use over and over again.
Objects - probably the actual implementation of the sprites with scripts to make a character.
Rooms - probably the same thing as maps including all of the above items.

Surely enough, I was right for the most part. That's basically the jist of everything. The documentation was not as good as I wanted it to be, and I've had a few problems doing things, so I'll go through it so you can learn -- the easy way.

This article will be all about our graphics. Actually, not really all about, just a general idea on how to get them to work. I opened up the included example, 1945, and found that the sprites are divided into animations. They continually run through the animations until switched. So, I saw that the airplane continually went through. If we were to make a sidescroller, we'd want a still pose and a moving pose for all directions.

Lucky for us, Game Maker does a lot of work FOR us. It figures out where the sprite is (and if it was hit) and sets the background color to the bottom left corner. (if you tell it that the sprite is transparent) Easy enough, right? Well, if we add a sprite, we can load it from a file. So, we'll click Load Sprite and select the first frame we want of that character.

Now, we'll Edit the sprite, so click Edit Sprite. Lookie here! It's the way the character should be looking in the animation. On the left is even a preview! To make it look right, we need to set it to the FPS. Most of you know FPS as Frames Per Second. This is also true in Game Maker. You set the room's FPS and then have an animation work in it. So obviously, the animation should be out for a little while, so it doesn't blur it goes so fast.

I want more than one image here for the animation. Nobody told me how to get it to work, and the documentation didn't really explain it, so I'm getting nervous, unable to figure out how to do such a menial task. Well, it's really easy, and I should've thought of it before. Click on File/Add from File to put in another graphic. Really simple. Do this and get the basic pattern. So, since I have 3 poses (moving in between, left leg out, and right leg out) I'll be using 4 animations. My sequence is as follows: Left Leg up, standing center, Right leg up, standing center. But if you preview it at 30 (or whatever FPS you have the room at) you'll notice it's going faster than a chicken about to be butchered. So, we need to slow it down.

It's another really easy step. Just click on the Animation file menu item, and click 'Stretch.' You want to put about 3 times the frame count to make it look good. So, since I have 4 frames, I'll stretch it to 12. Notice that it does all of the work of making them work just right so the character moves correctly, rather than like a lightning bolt? We'll click the little green check in the upper left corner of the toolbar to keep it.

So, we'll also want the character moving the other way, right? Really easy again. Just duplicate that sprite (right click and choose duplicate) Edit the sprite again, and select Transform from the file menu, followed by Mirror Horizontal. The character is now facing the other direction.

Yes, this is my sprited version of myself... Here's something to compare it with below...

A note to you though. I put my graphics for one character in a little folder (Group) called Terin. After all, I'm making a sidescroller about myself. It's about a guy who's a martial artist (okay, it looks a lot like me in my uniform) that I modified off of a Megaman X sprite. What he'll do, I'm not quite sure, but there's bound to be some cool stuff (like chi blasts, etc.)

That's all for now! Tune in for the next example when I explain how to put this into action, making the character move, and how to put this into a map.