May 24, 2017, 04:31:09 PM

Author Topic: Moving Platform Help?  (Read 1308 times)

mikale

  • Newbie
  • *
  • Posts: 11
    • View Profile
Moving Platform Help?
« on: December 22, 2014, 03:16:27 PM »
I am using this in my player class:
Code: [Select]
moveBy(xSpeed, ySpeed, "platform", true);
and then overriding the moveCollideX and moveCollideY to make  the player move with the platform when he is resting on it. But it's not working right. In my game I have a bunch of moving platforms and sometimes when jumping up to one the player will get stuck in one of them. Maybe moveBy is just buggy?

Can someone provide a good way to make moving platforms work in HaxePunk? I'll give you a free kitten if you do :)

jlauener

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Moving Platform Help?
« Reply #1 on: December 22, 2014, 10:08:37 PM »
No it is not buggy. You should also implement moveCollide on your platform entity and move the player accordingly.

mikale

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Moving Platform Help?
« Reply #2 on: December 24, 2014, 03:58:43 PM »
But that doesn't explain why my player is passing through and getting stuck in the platform sometimes.

jlauener

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Moving Platform Help?
« Reply #3 on: December 24, 2014, 10:22:34 PM »
if the platform moves it can go through the player. Then when you try to move the player it will get stuck. Moving platforms can be tricky. Search for haxepunk advanced platform engine. If I remember there is horizontal moving platforms there, could help. If not we need more details about of your implementation.