Sticky Platforms

Blitz3D Forums/Blitz3D Programming/Sticky Platforms

Hujiklo(Posted 2005) [#1]
I have a 2d-ish project with a lot of platforms which move in about the X and Y. I have collisions working well with NG collision system. The only trouble is getting the player to stay on a platform and be allowed to move as well.
I can position him on the platform correctly but when a few lines of code later I use translate entity to move him laterally on the X he fails to move at all in relation to the platform he just sticks to it like glue :(

Is there a sort of limit to positioning and translating and entity each game loop? Do they add up together correctly?

I've been at this for over 5 hours now and think it's time I asked for some help...anybody have any ideas?


Ross C(Posted 2005) [#2]
What i do is parent the character to the platform :o). DO a linepick straight down from his position. If he's no-longer on the platform, ie. the linepick returns no entity, unparent him :o)


Hujiklo(Posted 2005) [#3]
Thanks Ross!
As a side note and because I wanted to know why my code didn't work - i found out I was calculating a player/platform offset each loop instead of only when he first collides or moves...simple when you know how.