Detector lags behind player

For questions about using Classic.

Post » Sun Sep 07, 2008 9:19 am

Hi, this is my first post here, so please be nice to me :roll:

I'm making a custom platform engine, because I want to have double jump. wall jump and stuff like that.

Anyway, when I tell the detector to follow the player's position it lags behind.
How can I fix this?

Thanks in advance!

You also get a nice way to do X acceleration for free if you didn't know how to do it already :D
(Ok maybe I'm missing something there, TimeDelta perhaps?)

cap: http://www.mediafire.com/?sharekey=a4e6 ... b9a8902bda
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Sun Sep 07, 2008 11:50 am

I managed to make a double jump using the default Platform Behavior, check it out HERE!

Now I'll get to work on moving platforms, ladders and one-solid-side paltforms. :D
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Sun Sep 07, 2008 2:49 pm

Usually happens because of the order of events:

if you have

detector set x to sprite.x
sprite set x to whatever

then on the first event sprite.x isn't changed yet, it then gets changed after so the sprite is in a different position.

if you change it to
sprite set x whatever
detector set x sprite.x
it should work
B
2
S
2
G
5
Posts: 236
Reputation: 2,122


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests