Fangames > Programming Questions

elevator rooms with checkpoints

(1/1)

pieceofcheese87:
ok so, you all know what elevator rooms are? rooms that auto-scroll up or down sometimes caused by an object.
(in my case a mole.) How do you make it so if the player saves, the mole spawns up where the player saved instead of back at its spawnpoint?

Sephalos:

--- Quote from: pieceofcheese87 on August 04, 2013, 11:45:49 PM ---ok so, you all know what elevator rooms are? rooms that auto-scroll up or down sometimes caused by an object.
(in my case a mole.) How do you make it so if the player saves, the mole spawns up where the player saved instead of back at its spawnpoint?

--- End quote ---
The easiest way to do this would be to make two seperate rooms. Otherwise you would have to do something like with the mole object step event....

if checktimer < 5 { checktimer += 1; }
if checktimer = 1 {
If player.y < 'around 96 y lower than the save point';  {
y = 'location you want to spawn the mole on reload';
} }

So assuming your save point is at y400 the code would look something like this

if checktimer < 5 { checktimer += 1; }
if checktimer = 1 {
If player.y < 496;  {
y = 700;
} }

This probably not the best way to do this but this is all I can think right off the top of my head.

UltragamerxD:
maybe works ...
mole's create evet :
y=player.y+plus
//plus is if its lower or higher you know xD

Olivebates:
I would just spawn the mole in the bottom of the screen. So when you load, you set the moles y position to view_yview[current_view] + view_wview[current_view] - mole.sprite_height - 16.

The way you formulated it though, just set the moles y-position to the savepoints.

Navigation

[0] Message Index

Go to full version