Skip to content

3. Creating your first level

Gate edited this page May 7, 2025 · 16 revisions

3.1 Before creating a level

Do open any of the levels in the framework so see how they are composed, I highly suggest to keep the prebuilt levels to use them as reference.

image

3.2 Building levels

image

3.2.1 Setting up the room width and height

Open up the room and then open the inspector tab next to the resource tree and you should see this

image

Here you can set up the name of the room, the width/height of it. Do not touch the views as the game creates them automatically when the room loads.

3.2.2 Layers

imagen

GUI Layer

This layer must remain locked as it is used to place gameplay related objects such as the HUD and Transition objects.

Main Layer

This is the layer you have to use to place objects, the level control object must be placed in this layer.

Tileset Layers

This layers is where you have to place up the tiles your level will use, there's 4 different layers to use which I'll explain now:

  • Tileset
  • Tileset_Decor
  • Tileset_Platform_Foreground
  • Tileset_Platform_Background

Tileset is used for the floor, walls and ceilings. If you want to add semisolid platforms, do make use of Tileset_Platform_Background and add the finishing touches on the Tileset_Platform_Foreground layer.

Tileset_Decor is used for the decorations. Such as bushes, hills, etc.

Background Layer

Backgrounds go in this layer, they are composed like this on the sprite editor imagen

If you want a specific layer to scroll, in the creation code of obj_levelcontrol add the following code:

bg_scroll[<frame>] = <speed>;

If you want the background to be animated, open the variables of obj_levelcontrol in the room editor and set bg_is_animated to true. Make sure the background has multiple similar frames if you decide to use this option.

Foreground Layers

Two extra layers can be applied to the room, refer to the info found in the following objects to see how to set them up:

  • obj_tilelayermanager
  • obj_tilelayermanager_front

IMPORTANT: Layers must be at depth -6 and -7 respectively

3.2.3 Setting warps

If your level has one or more sections, you must make use of the objects inside the Warps object.

Here's a brief explanation of how warps work: image

First, place up a warp object on the pipe as shown in the image above. Once you set it up, double-click it to edit and then click on Variables.

Once you have the Variables window open, set up the destination room, exit direction (0, 90, 180 or 270) and warp ID.

And last, in the destination room do the following: image

Place a warp node, double-click it to edit and then click on Variables. Do set up the ID you set on the entrance in the myid variable to make Mario appear on the node with the same ID when the room starts.

Make sure to not use the same ID in the same room.

If you set mini to true in the warp object, said pipe can be used only when having the mini mushroom powerup.

If you want screen scrolling pipes, set up room in the destination variable (This method works too with doors).

This system also works for other type of warps (such as doors or beanstalks).

3.2.4 Setting branch warps

Setting branch warps are similar to normal warps, these will check for a condition before warping the player to another destination.

This is where the mode variable enters. The mode will check for 3 things: Coins, Time Left or A-Coins. imagen

The coins variable must not be modified as it'll be updated for every coin you collect on the room.

The mode variable must be altered to check for Coins, Time Left or A-Coins. (0 is Coins, 1 is Time Left and 2 is A-Coins)

Modify the target variables and the destination variables to set up the different room destinations and the object will act as a normal pipe.

3.3 Setting Music

Setting music on GME9 is really easy, all you need is to place up a .ogg file inside the datafiles folder.

First, find and open the datafiles folder and you will find a folder and a .ini file inside

imagen

Second, open the 'music' folder and paste there the .ogg file you want to use

imagen

Then go back to the previous folder and open up the .ini file and you will see this

imagen

For example, if your music is named lava.ogg do a section as is inside the .ini file [Lava] song_name = "music/lava.ogg" loop_s = 0 loop_e = 10.00 loop_s and loop_e are used to set the loop points of the music, keep in mind you have to use the seconds/hundredths format for it.

Once you are done setting up the music, go into the obj_levelcontrol object, open up the 'Variables' and click the cogwheel next to inisection

imagen

You will see this window pop up at the right

imagen

Click 'Add', write a new option between "" called Lava and then you should be able to use the music you just added.