Wednesday, September 1, 2010

Day 1-3 - Now it gets serious: The serious continuation

Yep, now for some serious work:

Day 2-3: Some assembly required

This day will involve your first delving into Drag&Drop programming in GMaker, to assemble the menus, and fill out some basic game information

First, a Screenshot with everything marked out:


Rooms (#1, in black outline) - This is the area, by right clicking on it, you can make and name empty rooms, based on the rooms required by your game (Menus, Levels, Etc.)

Game information (#2, red outline) - This brings up the "F1 screen" which is an area you can type in to explain things about your game (Default keys, what powerups do, enemy types, etc.)

Global Game Settings (#3, teal outline) - Here is where you choose things like game resolution, fullscreen, fill out overall game info (Game version, etc.) and more, be careful with some of these settings, they can cause problems on some machines (Like forcing Vsync or Refresh rate changes)

The Process Begins

First things first, Create a series of empty rooms in the Rooms folder by right-clicking on it and choosing create room, name them to correspond to the needed rooms for your game, it'll look something like my rooms folder for projekt H when you finish:

You may have noticed i'm "Missing" a room, fear not, i'm saving it's creation for this next part

Making the magic - The game maker way

So, now you have a lot of blank rooms, a bunch of game-sized paint images showing button placement and layout, and a few questions

Well, time for me to answer them, here's how a room generally works:

1. The game loads the room
2. All objects in the room at creation become active
3. Any "Run on object creation" codes run
4. If no other actions, room goes into a "Paused" state

Now, for that missing "rm_player_select"

First, it needs a background, so i'm going to import it into GM8, by right clicking on the "Backgrounds" folder, clicking create background, then hitting "Load background" and navigating to it in my Projekt H Placeholders folder, when i'm done, i get this:

Upon hitting "OK" i've just made bg_playerselect with the placeholder image of img_placeholder_playerselect

Now, to make the room use it, and to make the "Abort" button, i make the room, go to its settings tab, and set the room name to "rm_playerselect" and it's size to 800x600 from the default of 640x480, The room "Caption" is what the game displays at the top bar if it's visible, like how your browser shows it's name at the end of the website title, so all of them should be the same, in my case, just "Projekt: H" without quotes

Now, under the "Backgrounds" tab, there is an option that will say <no background> with a box next to it, click on the box, and select your background, in my case, bg_playerselect, when you're done, the room will look something like this:

The grid just shows you the snap to grid if enabled, for now, mines at 16x16 snap, but more on this later

Part 4 - Sprites, Objects, and a bit of D&D

Now, as you can tell from that screen, eventually the 3 boxes are going to show the 3 different ships, and their weapons + Stats, the abort key will go back to the previous menu (Game type selection)

Now, to do this, we need to make a sprite for the abort button, like so:

but you say "It doesn't say anything!" - Thats because this is a base for all of my large-type buttons

So, under sprites, i right-click -> Create sprite, name it spr_return, and load this image, like so:

Now, rather than hit OK, i hit "Edit sprite" bringing up the game maker sprite editor, i then click on the little pencil at the end of the tray to bring up the graphic editor, and use it's text tool to finish my button, like so:

After which, i click the green checkmark in both windows to accept my edits, and then accept the sprite, and then click OK To save the sprite to my file

At this point, i also save my .gmk file, since i've done a lot of editing

Part 4 - Redux

Now, Sprites are little more than fancily-named images, you have to make them into Objects for you to be able to code anything with them, so now we right-click on the objects folder, select "Create object" and then set it to use my newly-made return button sprite

Now, since it's going to be a basic return key (Like hitting escape) i'm also going to add a clicked event using D&D that makes it so clicking on it will return to the previous room, which in my order, is the gametype select, so it looks like:

In short, the object will ignore everything, but if you click on it with the left mouse button, it will trigger the event, making the game go to the previous room, now, i place it in my room by selecting the object and then left-clicking on my background where i have my "Abort" button lined out:

Note: All my button sprites have transparent edges

Now, another thing to note is that this button is UNIVERSAL, meaning any room i put it in it will work, the event doesn't jump to a specific room, just whatever room you were in before the room you clicked it in

This differs it from my "Return to main menu" button, which SPECIFICALLY jumps the game back to the main menu room

So now, by the end of Day 3, you should have the following done:

1. The game design text document outlining the game
2. The placeholder graphics for the game (Buttons, backgrounds, Player ships, etc)
3. The game partially built with navigable menus and placeholders
4. The game information all filled out

If you have all 4 done, congratulations! you're ready to begin the hard part - Coding it all

That will be covered in a future post though, that's a lot of typing for me to do and images to make, so it could take another couple days before you see it


No comments:

Post a Comment