XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Creating a moving platform within the Platformer Starter Kit?

Last post 11/21/2009 2:59 AM by WolRon. 3 replies.
  • 11/18/2009 12:16 AM

    Creating a moving platform within the Platformer Starter Kit?

    Hey guys, I've been doing some work on extending the platformer kit, and was wondering if anyone could give any pointers on creating a moving platform that the character can stand on, and be transported along with the platform? Any help would be greatly appreciated.

    Thanks

    Michael
  • 11/18/2009 2:49 AM In reply to

    Re: Creating a moving platform within the Platformer Starter Kit?

    I've never had to do this myself, but if I was going to, I'd probably do it like so:

    Every update:
    - move platform
    - note delta movement of platform for later use
    - apply gravity to players character
    - check if there's a collision with the platform
      ~ If so, readjust character so that it rests (again) on surface of platform
      ~ now attempt to move character in same amount and direction that platform previously moved  (this may or may not succeed depending on your surroundings)
    - (if standing on a surface/platform) attempt to move character according to controller input
    Frighten your friends and family with: Scare Me

    Help customers using GRENADES?!?: GoonyCru: Day One

    BASIC Programming Tutorial
  • 11/20/2009 3:56 PM In reply to

    Re: Creating a moving platform within the Platformer Starter Kit?

    Would it be possible to apply this to a platform positioned from a level map text file (as in the Platformer Starter Kit)?

    I have been told about path following algorithms, would these be advisable?

    Thanks
  • 11/21/2009 2:59 AM In reply to

    Re: Creating a moving platform within the Platformer Starter Kit?

    michaelj89:
    Would it be possible to apply this to a platform positioned from a level map text file (as in the Platformer Starter Kit)?
    I don't see why it would make a difference.  You will just have to make sure to take note of each platform in your code as it's loaded in.  This may require a list object to keep track of them.
    michaelj89:
    I have been told about path following algorithms, would these be advisable?
    I don't see how that would apply.  You aren't forcing the player to follow the platform, and you aren't making the platform follow the player (unless I misunderstood you).
    Frighten your friends and family with: Scare Me

    Help customers using GRENADES?!?: GoonyCru: Day One

    BASIC Programming Tutorial
Page 1 of 1 (4 items) Previous Next