I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: pieceofcheese87 on August 04, 2013, 11:45:49 PM

Title: elevator rooms with checkpoints
Post by: 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?
Title: Re: elevator rooms with checkpoints
Post by: Sephalos on August 05, 2013, 12:10:31 AM
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?
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.
Title: Re: elevator rooms with checkpoints
Post by: UltragamerxD on August 20, 2013, 01:06:59 AM
maybe works ...
mole's create evet :
y=player.y+plus
//plus is if its lower or higher you know xD
Title: Re: elevator rooms with checkpoints
Post by: Olivebates on September 26, 2013, 07:55:53 AM
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.