Professional Documents
Culture Documents
Engine Codes
Engine Codes
By Pwyskowski
Game Controls (keyboard):
MapScreen: Arrow keys move Mario around, End - Pause, Enter-Enter a level
Game Levels:
Left/Right Arrows walk
Ctrl - Run/Fire/tail
Alt - Jump/Fly/Swim
Alt+Up – Jump higher out of the top of the water
End –Pause
Up - Enter a door / Upper pipe
Down – Duck / Enter down pipe
Enter – Open Treasure Chest
Alt (while holding Down)-Turn Tanooki into Statue (let go of down to change back
to Tanooki)
Debug/Cheat Keys:
MapScreen: + goto next room, 1-6 Change Mario's Powerup, M - Toggle Music,
Backspace=restart
Game Levels:
Left/Right -- walk
Button 2 - Run/Fire/tail/Open big chests
Button 1- Jump/Fly/Swim
Button 1+Up – Jump higher out of the top of the water
Button 3–Pause
Up – Enter a door / Upper pipe
Down – Duck / Enter down pipe
Button 2 (while holding Down)-Turn Tanooki into Statue (let go of down to
change back to Tanooki)
*To use a gamepad you must press J to toggle between gamepad and keyboard
The first is myflashcolor which default is c_red . This is the color that you wish
to have flash in the background.
The second is mybgcolor which default is c_black . This is the color that you
wish the background to be normally.
To setup the bgflasher object, put the following code into the creation code of the
room.
instance_create(0,0,bgflasher)
//or place them in the room using the room editor
with instance_find(bgflasher,0)
{
mybgcolor=c_black
myflashcolor=c_red
}
Bridge/Axe
When Mario makes contact with the bridge axe, each Bridgepiece is destroyed
one at a time (in order of instance). If Bowser exists in the room, he will be
destroyed as well. An animation of him falling off the bottom of the screen will
occur when all of the bridge pieces are destroyed. Since the Bridgepiece(s) are
destroyed in order of instance, it is best to place them in the room in the order
that you wish to have them destroyed.
with instance_find(big_chest,0)
{
roomdestination=room
item_inside=Mush
}
Note: when there are multiple Big Chests in the same room, all of the other Big
Chests will deactivate when one is opened.
Small chests are usually for hammer brother duels but can be used elsewhere
as well. By default they are invisible until all of the monsters in the room are
destroyed. However, you can make it visible in the room's creation code if you
wish to use it in another type of situation.
with instance_find(smallchest,0)
{
roomdestination=room
item_inside=Mush
}
show_score=false
global.just_died=false
With (instance_id)
{
sprite_index=maplevel1
roomdestination= room
instant_entry=false
blocking=false
}
instance_id represents the instance number of the MapLevel that you wish to
set the destination of.
sprite_index is used for choosing the Map Level icon for the instance. Default is
maplevel1.
Room is where you put the room name for the destination. Just using the word
"room" will just make it so nothing happens when Mario is on the icon with the
player pressing enter.
Instant_entry can be set to either true or false. If it is set to true, the player will
automatically enter the level upon contact with the Map Level icon.
Blocking is used to make it that Mario cannot pass a Map Level icon without
completing it first. The default is false for most MapLevel object except for the
MapFortress object, which is set to true by default.
MapFortress/MapLocks
The MapFortress object has 2 variables that can be set:
destroylock=true
mylock=114649
mylock is set to 114649 which is the ID number of the instance of the MapLock
on the MapScreen. So when the fortress is destroyed, the lock is destroyed as
well.
Roomdestination is used just like any MapLevel object to set the room you wish
Mario to travel to when enter is pressed while standing on it. If it is not set to a
room name, the pipe won’t send Mario to another room. Instead he will be sent to
another location in the same room by using the pipe_exit variable.
Maze Pipes:
Maze Pipes have 2 variables that can be set
Pipedestination must be set to in the room’s creation code to set where Mario
emerges when he enters this pipe. This variable MUST point to another Maze
Pipe or Mario will not emerge from anywhere. If this variable isn’t set at all, Mario
won’t enter the pipe. This can be helpful in making a one-way pipe.
with (118452) // Repeat with the other end and set its
{ pipedestination=118448 } // destination to the first pipe
Quicksand:
Mario sinks when standing on or in quicksand. Also, walking through quicksand
will slow Mario down. If Mario falls too deep (about 6-8 pixels from the bottom)
into a quicksand block, he will fall out of the bottom of it. If you have quicksand at
the bottom of room, I would recommend placing an extra layer of it underneath it
off the bottom of the room to keep Mario from falling through prematurely.
Roulette Block:
These are used at the end of levels. When Mario hits one of these from
underneath, he will get a ‘card’ and then return to the current mapscreen.
When Mario gets 3 cards, he will be rewarded with extra live(s).
If all 3 cards match, you will be rewarded as follows: Mushrooms (2 lives),
Flowers (3 lives), Stars (4 Lives).
If they don’t match, you will receive only 1 extra life.
To get the scroller moving just use vspeed(negative values to scroll up) and
hspeed(positive values to scroll forward). The best place to do this is in the
room's creation code.
As a side note: I added what I call a "scroll trigger" to the engine example
(vines_to_climb room). This shows how you can make an object quickly change
to a scrolling screen when Mario reaches a certain point to give an extra effect or
to activate a boss.
Start Pipes:
Start Pipes are for levels where you want the level to start up with Mario coming
out of a pipe. Simply place the start pipe that you want Mario to begin the level at
wherever you want but do not place a Mario object in the room. Also, you need to
set the view_object for view 0 to the start pipe that you used in the room. For
example in the “pipe_corridor” rooms, since Mario is coming out of a
startpipe_down that is the object that view 0 is set to.
Switches:
There are 3 types of switches.
The first is the coinswitch. This switch turns all coins into dud blocks and all dud
blocks into coins. The second type is the Bluebuttonu. This switch will destroy
all of the Blueblock(s) in a room. The third type is the giant switch. These
switches will turn empty blocks of the corresponding color into powerup blocks of
the corresponding color. Since the giant switches use a global variables, any
empties in other rooms will also be effected when Mario steps on it as well as
any other giant switches of the same color. This was designed to help make
multi-room puzzles.
with (118487)
{ destination_door=118486 }
with (118486)
{ destination_door=118487 }
By using the proceeding code in the room’s creation code event, 118487 and
118486 are two Teleport Doors and they are now linked to each other. When
Mario is standing in front of one of the doors and up is pressed, he will be
teleported to the other door.
with(Instance_ID)
{
vines_inside=9
}
Instance _ID represents the instance_id of the VineBlock and vines_inside is the
number of segments long you want the vine that is generated to be. In this case
the vine is 9 segments long.
If you overlap a jumpthrough block with a climbable_object (vine), you can stand
on top of the vine (but not climb back down it). Then using Tiles, create a layer
(set the layer to 1) and place a graphic over it (in this case I used a cloud) to give
the effect that Mario climbed up onto the cloud.
with (instance_id)
{
roomdestination= room
}
Instance_ID is the instance_id of the Warp Pipe that you wish to set the
destination.
"room" is where you put the room name for the destination. Just using the word
room will just return you to start point of the room you are already in.
Water:
When Mario comes in contact with water, he will go into swim mode.
There are 3 different sized water blocks to make placing it easier than ever.
When Mario is at the top of a body of water, the player may press up and jump at
the same time to jump higher out of the water. As a cautionary note, Mario will
fall out of the bottom of a water block if he is too close to the bottom of it(about 8
pixels). In a level where you have nothing under the bottom of the water (like a
pit), it's a good idea to put a couple of the smaller water blocks underneath it off
the bottom of the screen to keep Mario from falling prematurely, the same goes
for quicksand.
Bob-Ombs: These little buggers will start flashing and then explode after a
random amount of time. They can be stomped to stop them from moving and
then kicked around by Mario. The only way they can be destroyed is by hammer
or by an explosion by another bomb. There are 2 versions that can be placed in a
room. The first starts its countdown to explosion immediately after being created.
The second waits until it comes into view. I would recommend using the second
version for most stages. The first version is generally used with the
Lakitu_bomber object. As a side note:explosions from bob-ombs destroy
breakable bricks.
Bombing Lakitu: This guy drops bombeggs down at Mario. There are 3 versions
of it. The first drops bombeggs that become bob-ombs. The second version
drops bombeggs that explode on impact with any solidblocks. These explosions
will destroy any breakable bricks that they come in contact with. The third version
of the lakitu_bomber randomly drops bombeggs that explode on impact and
those that turn into bob-ombs. Bombing Lakitu's just like any Lakitu, is best
placed above Mario about 9 squares or about 11 squares from the bottom of the
view.
Blooper: These squids will stalk Mario wherever he is. There are 2 versions. The
first can be placed anywhere in a room and will start moving towards Mario when
they come onto the screen. The second type are best placed outside of the room
(far left or right, I don't recommend having them off the bottom of the screen) and
they will periodically repop if destroyed.
Flying Fish: These cheap-cheaps continually fly up from the bottom of the
screen towards Mario. Place them off the bottom of the screen and they will
continue to repop after being destroyed by Mario of by falling off the screen.
with (instance_find(invincible_flower02,0))
{alarm[2]=105}
alarm[2] is the alarm used for the initial delay before the
flower first starts moving up/down.
JellyFish: These are completely indestructible and do not move. Mario will take
damage it he comes in contact with one (unless he is invincible).
Paragoombas: These come in 2 versions. The first moves like a regular goomba
except that it hops every once in a while. The second hovers in the air, dropping
baby goombas like they were bombs.
Ptooie Plants: These come in 2 versions. One walks back and forth, while the
other is stationary and should be placed atop of a pipe.
Spiny: Use the Spiny2 when placing them directly in a room. The other is used
by Lakitu and self destruct when out of view.