How do I spawn to a certain platform after death?

Get help using Construct 2

Post » Thu Jul 07, 2016 11:42 am

So basically, if my player falls, he is reset to the start position.

The problem is, if the player is jumping from a different platform, he'll still be reset to the start platform.

How do I change it so that you are reset to the last platform you were standing on?
B
3
Posts: 2
Reputation: 179

Post » Thu Jul 07, 2016 1:48 pm

You can detect which platform your player has landed on by having an invisible sprite under him, or by using overlap at offset.

You can then have an instance variable for each platform that gets set to "1" as he lands on it - and set all others to "0" (use a for each platform loop).

Then when you respawn, create the player at the platform that has the instance variable set to 1.

Hope that made sense.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Fri Jul 08, 2016 10:37 am

I'm very new to this, so this may take a while to figure out haha. But thanks.
B
3
Posts: 2
Reputation: 179

Post » Fri Jul 08, 2016 11:28 am

If I can get my kids to settle down to bed here soon, I'll try to make a quick example for you :)

*EDIT*
Here we go... using the standard C2 "platformer" template, I quickly made the last few events on the event sheet so it records which platform you touch last.

It only records static platforms, but you could make it do any platform, or maybe just a specific platform or "checkpoint".

DOWNLOAD CAPX

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499


Return to How do I....?

Who is online

Users browsing this forum: AnD4D and 42 guests