Jump to content


Photo

Create Checkpoint


  • Please log in to reply
1 reply to this topic

#1 JohnCiber

JohnCiber

    GMC Member

  • New Member
  • 8 posts

Posted 23 February 2009 - 07:19 AM

Hi
I want to create an object, that when the principal character pass though them, this save the position and if you die, appear again from here

Well, that's all, thanks!! :o
  • 0

#2 ragarnak

ragarnak

    GMC Member

  • Retired Staff
  • 19468 posts
  • Version:GM8

Posted 23 February 2009 - 08:32 AM

I want to create an object, that when the principal character pass though them, this save the position and if you die, appear again from here

When your player collides with the checkpoint-object you can simply either store its coordinates :
//player collision with checkpoint-object
Checkpoint_x=other.x
Checkpoint_y=other.y
Now when you "die" you can either just jump back to those coordinates, or create a new player-instance at those coordinates and destroy the current one (to reset all the players variables).

Hope that helps.

Edited by ragarnak, 23 February 2009 - 08:32 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users