Bobbing platforms

Get help using Construct 2

Post » Thu Oct 11, 2012 11:23 am

Hello

I'm new here, just started using Construct and working on my first game!

Im wanting to make a platform that bobs/sinks down slightly (say 50 pixels) when the player jumps on it, then reverts to its original position when you jump off.

I thought this would be easy but I keep hitting a few blockers. I tried using the Lerp and Clamp commands to make it move down slowly which did work but I had the issue of my player always colliding with it so it continued down off the screen. (How do I say do this command only once when you collide with the platform?)

As for getting it to revert to its original position I couldnt get that working at all and wasnt sure where to start. I thought Id create an else command on the collision detection that makes it move back but I wasnt able to find a way to add it to my event sheet (it was greyed out).

Im at work at the moment so dont have a Capx but would appreciate some advice or pointing to a tutorial that I may have missed.

I later installed the Ease Tween plugin and that gave me a nice elastic motion, but it either kept moving down or looping from the original position (again, same issue of only wanting to play the motion once and then revert when you're not in contact anymore)

Here's a little diagram to illustrate what I'm trying to do :)


Thanks
Simon
B
8
S
2
G
1
Posts: 21
Reputation: 1,492

Post » Thu Oct 11, 2012 1:13 pm

[quote]I thought this would be easy but I keep hitting a few blockers. I tried using the Lerp and Clamp commands to make it move down slowly which did work but I had the issue of my player always colliding with it so it continued down off the screen. (How do I say do this command only once when you collide with the platform?)[/quote]

There's a condition you can add called TRIGGER ONCE WHILE TRUE.vandinz2012-10-11 13:24:23
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Thu Oct 11, 2012 1:39 pm

I've managed to get something like you wanted using an instance variable on the platform. Hope it helps.

Here's the CAPX

and a DEMO
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Thu Oct 11, 2012 2:00 pm


Thanks Vandinz, that is what I was looking for. I will try and hook the soft movement back into it. I just needed a prod in the right direction.

Simon :)
B
8
S
2
G
1
Posts: 21
Reputation: 1,492


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests