First, thanks for taking the time to make the tut. I've just started in GM8 and your tutorial combined with the help file and Google has advanced my knowledge
drastically in the past few days. I have 0 prior coding knowledge.
This is an old topic, but I just found it...
My question to any reading is this... using Derek's tutorial, I am trying to add checkpoints.
I have set up 3 objects:
1. oSpawn - player object is set to be created here
2. oInvisoWall - when this collides with oPlayerShip, oSpawn moves to position oCheckPoint
3. oCheckPoint - an invisible block placed near the wall of oInvisoWall objects
oGameController Step Event code
// Revive the player if he dies
if (not instance_exists(oPlayerShip))
{
if (reviveTimer > 0) reviveTimer -= 1;
else
{
instance_create(view_xview[0]+32, view_hview[0]/2, oPlayerShip);
oPlayerShip.x = oSpawn.x;
oPlayerShip.y = oSpawn.y;
view_xview[0] = oPlayerShip;
}
}
Pretty much Derek's code that makes the player jump to the oSpawn position and snaps the scrolling view back to the player.
The first time I test it, oPlayerShip respawns at where oCheckPoint is placed, no problem. The second and every other time, oPlayShip respawns at (x of oCheckPoint) but at (y of 0), or the top of the screen.
I have instances outside the view deactivated except for the oCheckPoint and oSpawn, they stay active.
I can't yet figure out why after the second respawn it goes to the proper x position but its y position is at the top of the screen.
Update:
I have added a visible sprite to oSpawn and noticed that after the play respawns the oSpawn object jumps up the y axis to 0. If oPlayerShip collides with oInvisoWall again, it resets the oSpawn object to the proper position.
I don't know the language well enough to figure it out yet. I will have to keep trying after I get homoe from work.