Pages

Wednesday, June 13, 2012

1: Starting Out

The first question you're probably asking is "What the heck kind of game are you making?" I don't plan on going into too much detail, but I think a great game to learn the basics with would be a 2D Platformer. Instead of making a more generic platformer such as Mario, though, and because I'm trying to teach programming instead of level design (which I'll admit I'm terrible at), I want the game to be more combat based, and take place in an arena style map.

I'm hoping this will force me to learn how to, and eventually teach how to program:
     Basic Platforming Engine (including Double Jump, and Dynamic Jump)
     Non-bullet Attacks (including Sequence Attacks, Aerial Attacks, and Multi-Hit Attacks)
     Damage Physics (including Launching and Hit-Stun)
     Grabbing (how to keep it from looking silly)
     AI (nothing insanely complex, but still one of the biggest challenges)
     HUDs (score keeping, health meters, etc.)

This probably leaves out some aspects, but a huge reason I've started this blog is because some of the above elements are really difficult to find help or guides for, partly because it's very subjective to YOUR game and coding style. Again, I'm hoping to teach you how to code for yourself, not copy and paste what I make.

That out of the way, let's open up Game Maker and put it to use.

You'll miss this screen looking so bare.
Before we can even test our project, we need a map. Before we can even build a map, we need objects. Before we can even program objects, we need some sprites to be able to see the objects. I suppose I could spend a few hours whipping up some terrible character sprites, but I've got a much better solution.

I <3 boxes.
Right now, I don't need to worry about character animation, and since I don't use precision collision checking (and I would almost never recommend it), the game pretty much sees objects as rectangles anyway. I do want to be able to differentiate the objects, so I made three sprites. The first is the player's object, a thin rectangle that will later become the player's mask (something that will come up later). The second two are separate sprites for the floor and wall. As you can see, I name sprites with "spr_" at the beginning. I find this keeps everything organized better and prevents name overlap.

Next I make the objects. No picture is needed this time, I just make three separate objects called obj_tanner, obj_floor, and obj_wall, then apply their sprites. The only confusion may be on "tanner", but it's a habit of mine to name the player object the character name instead of "player".

Finally, the map itself. I'm not worried about resolution or anything special, I just want to make a small map for testing purposes.

As you can see here, I've made it about as simple as possible. The floor is slightly elevated just for aesthetic purposes. The walls are placed just off the screen. There's no roof, but until I put in something that could possibly launch the player over the walls, I'm not too concerned.

And that... just about wraps up the basic set up. At this point, it's nothing complex, and unless you've never used Game Maker, shouldn't take you more than a half an hour. Next post however, we get our player to move left and right, and learn some basic GML commands.

No comments:

Post a Comment