 |

 How to move in another room?
The current room depends on the player's position.
To move him in another room, simply set it's coordinates P_X and P_Y
at the desired position in the map. You can also use the PlayerSetPos() function, for easy setting.
Consider that the player's position is not in the top left corner of the tile, like for the brushes, but in it's center bottom.
It is easy to move to the desired position with the debug keys and note the current player's coordinates
displayed in the game's console.
Read more, in The Player chapter from the DizzyAGE book.
 How to avoid jumping with the up key?
If your game needs to use the up and down keys for other purposes, you must instruct the default template,
not to make the player jump, when the up key is pressed.
To do so, in the gamedef.gs file,
set the SUPPORT_JUMPUP define to 0.
 How to swim?
The swimming feature is implemented in the default template, but you need to activate it, if your game needs it.
Add some brushes with water material and, in the gamedef.gs file, set the SUPPORT_WATERPLAY define to 1.
You may also use an oxigen mask item, to avoid drowning and a flippers item to swim in the Dizzy 5 style.
Specify their IDs in the ID_SCUBA and ID_FLIPPERS defines.
Bubbles special effect is also supported.
Add a number of PLAYER_BUBBLES (12 default) bubbles in the map, as dynamic objects with consecutive IDs.
Specify the ID of the first one in the ID_BUBBLES.
For an example, see the WaterPlay tech demo.
 How to activate the custom movement?
At the end of the HandlerPlayerUpdate,
set the player's P_CUSTOMMOVE property to 1 and call
your custom movement function.
For an example, see the Shrink tech demo.
 How to reverse left and right keys?
You can do a tricky puzzle by reversing the left and right keys functionality.
So, when the player presses the left key, Dizzy would move to the right.
To do so, you have to write code in the room update handler.
If it's only to happen in a specific room, add the code in the room's update callback.
Basicaly you should read the curent state of the left and right keys and reverse their values,
like in the following example:
You may want to do the same for the key hit values if they are to be used.
 How to make the player jump on a trampoline item?
This is like jumping on a mushroom, but instead of having a static brush with jumper material,
you have a pickable item. Like the trampoline in Dizzy V.
It may not be as easy as making a solid box item (with the hard collision),
but I will briefly present two methods.
The first one is a trick that uses a static invisible brush with a jumper material.
This fake brush is placed over the trampoline item, when it is dropped down.
When the trampoline is picked up, the fake brush is set to no longer write it's jumper material in the material map.
Of course, the refresh of the material map is required in both situations.
The limitation of this method is that if you have to move the trampoline into another room,
you can't move the static brush too. Static brushes may not be moved out of their original room.
So you'll have to use a different fake brush for each room, where you could drop the item.
Hopefully these are not too many, since such an item can be really tricky for the level design.
The other method is to adjust the player custom movement to detect the trampoline item,
when it tests for dynamic objects with hard collision.
The item will have the collider property set to such hard collision.
And of course, this will work if you set the player's custom movement.
Here is the new adjusted function, from the movement.gs file:
There could be other methods of implementing this, like associating a dynamic object to the item,
instead of a static brush, to be able to relocate it in any room you need. You can use the collision
handler to test and force the jumping, but there are a few hacks to get it perfect.
|
 |