How do I implant a checkpoint system?

Get help using Construct 2

Post » Fri Nov 04, 2011 11:34 am

Im working on a platformer and I want to implant a checkpoint in certain parts.

How is it possible?

The only way I figured is with cloned sprites.

From A to B, every time the player dies by the Enemy1 he spawns in the beginning, from B to C, every time the player dies by the Enemy CLONE, available only in the B to C area, he spawns in that area, and so on for each zone, C to D, D to E, etc.

Does anyone know other way instead of cloning sprites and doubling the code as well?

Many thanks :)
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Fri Nov 04, 2011 11:54 am

If I'm understanding you right, you could do it much more simply than that. Have an invisible box that serves as a checkpoint, with a private variable that says which checkpoint it is (first, second, etc). Then have a global variable that keeps track of the last checkpoint you overlapped. Then, when you die, check the global variable and spawn your player at the checkpoint equal to the stored number.

Sound good?
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Fri Nov 04, 2011 12:16 pm

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Nov 04, 2011 12:28 pm

You guys rull :)

I'll check this capx to see how I can mixed with the code I already did =)

will give you feedback soon.
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Fri Nov 04, 2011 12:35 pm

"You guys rull :)"

Thats true. I needed this one to. Thank you!TastyBytes2011-11-04 12:36:49
B
14
S
2
G
6
Posts: 110
Reputation: 3,849

Post » Fri Nov 04, 2011 1:38 pm

I had some incompatibilities with the previous code

Can I share my capx and see if you give it a try?
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Fri Nov 04, 2011 3:34 pm

Sure thing, we can take a look.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Fri Nov 04, 2011 4:02 pm

Here's the 'headache' :)

http://dl.dropbox.com/u/1056957/05.capx

thanks a million :)
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Fri Nov 04, 2011 4:26 pm

In the group "Restart" event 33 :
Add the action Ball.set animation "return"
System set TIMER to 60
Audio play oddbounce (if you want the sound to play on respawn).

In the Group "Player dies" for each condition of death (collision with death, collision with ennemy, etc...) :
Delete the previous lines ^
Add System activate group "Restart"
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Nov 04, 2011 4:53 pm

t.h.a.n.k.s.
:)
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Next

Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Yahoo [Bot] and 19 guests