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

Additional Platforms? Need a slippery & hazard platform.

Last post 12/23/2008 2:15 AM by Brandon Bloom. 6 replies.
  • 12/22/2008 5:27 PM

    Additional Platforms? Need a slippery & hazard platform.

    Does anyone know how to make a slippery and/or a hazard platform?
  • 12/22/2008 5:50 PM In reply to

    Re: Additional Platforms? Need a slippery & hazard platform.

    I'm assuming you're talking about for the Platformer starter kit? What do you mean by "hazard"?
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 12/22/2008 6:53 PM In reply to

    Re: Additional Platforms? Need a slippery & hazard platform.

    Slippery: Assuming that you have physics implemented, set friction of the surface really low. If you don't have physics implemented: first, implement physics.

    Hazard: Assuming that you have triggers for various surfaces implemented, make a trigger that kills the character. If you don't have triggers implemented: add an Event or similar to the in-game representation of a platform, and when something touches that platform, fire the Event. Use this Event as a trigger.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 12/22/2008 9:15 PM In reply to

    Re: Additional Platforms? Need a slippery & hazard platform.

    Thanks jwatte! Any chance physics & triggers are explained in the documentation? Or - does anything in the platform starter kit currently use either that I can learn from?
  • 12/22/2008 9:27 PM In reply to

    Re: Additional Platforms? Need a slippery & hazard platform.

    There's no built-in physics support in the XNA Framework but some libraries have been created. You can check out Ziggy's site for some info.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 12/23/2008 12:00 AM In reply to

    Re: Additional Platforms? Need a slippery & hazard platform.

    Will do, thanks Jim!
  • 12/23/2008 2:15 AM In reply to

    Re: Additional Platforms? Need a slippery & hazard platform.

    jwatte:
    If you don't have physics implemented: first, implement physics.


    Full physics seems like overkill! The Platformer Starter Kit already defines two "drag" constants for when IsOnGround is true and when it is false. The simplest solution here is to replace IsOnGround with an enum thats what surface you are standing on: None, Ground, Slippery. Then choose the correct drag constant from that. See "Apply pseudo-drag horizontally" in the Player.ApplyPhysics method

    A "hazard" tile can also be implemented quite simply without a complex trigger system. Define a new tile collision type in the TileCollision enum. In Player.HandleCollisions, simply test against your new collision type inside the "if (depth != Vector2.Zero)" block of code.

    When you are learning -- and even when you are a pro -- remember to keep it simple!
    Brandon Bloom
    Software Design Engineer
    XNA Platform and Tools
Page 1 of 1 (7 items) Previous Next