Results 1 to 8 of 8

Thread: [Platformer]Slope detection/resolver

  1. #1

    [Platformer]Slope detection/resolver

    http://teamimpulse9.com/Platformer/Platformer.html (WASD to move)

    I'm working on a adventure/platform game and I want to be able to include a stage with slopes and inclines.

    My game works fine with flat ground and walls. What I did was create htiboxes for my charcter and if collision was detected it would calculate the angle of collision and set the charcters X velocity or Y velocity to 0. However, this method doesnt work well with inclines and slopes for obvious reasons.

    Does anyone know the proper way in dealing with this? BTW, I dont think it matters but I am using BitmapData for my stage and collision (aka no hitTest).

    EDIT* I found a video that breifly shows an example of slope detection in action, however there is no explanation on it's structure. http://www.youtube.com/watch?v=c9li34vNSrY (It's about 2 minutes in)
    Last edited by substance; May 12th, 2008 at 03:58 PM.

  2. #2
    Here's a good tutorial with source code on how to use vectors:

    http://www.tonypa.pri.ee/vectors/start.html

  3. #3
    Quote Originally Posted by Jerryscript View Post
    Here's a good tutorial with source code on how to use vectors:

    http://www.tonypa.pri.ee/vectors/start.html
    sry but that doesnt help me too much i need it to be laid out for me so i can can easily do it

  4. #4
    well i havnt ever done this but ive seen it where the character has a small dot in frotn of him and im guessing that when the characte hits the ground it just rotates until it has the dot hit the ground but also you should try putting your left and right movement speeds into different variables for as it is now if you walk up to the wall your stuck.

  5. #5
    Quote Originally Posted by Jerryscript View Post
    Here's a good tutorial with source code on how to use vectors:

    http://www.tonypa.pri.ee/vectors/start.html
    Wow, that looks EXTREMELY usefull. I've been to that site before but for some reason I remember it being mostly about tiles.

  6. #6
    Quote Originally Posted by coolcat View Post
    sry but that doesnt help me too much i need it to be laid out for me so i can can easily do it
    It is laid out quite clearly over multiple pages. You've just got your work cut out for you.
    you = function(){
    setEnabled( true );
    live();
    setEnabled( false );
    }

  7. #7
    207
    posts
    Registered User
    I'm pulling this out of the air based on the Fancy Pants video, but try it that when the right dot hits the ground, rotate the four dots upward using the left dot as the centre point, and when the left dot hits the ground rotate using the right dot as the centre point.

  8. #8
    Well even though tonypa's tutorials are extremely usefull and I've learned alot after reading it over (quite a few times) his examples dont cover my specific problem.

    However I did find a tutorial that looks like will explain exactly what I need. (cant look at now)

    http://worldfaction.com/forums/viewtopic.php?f=18&t=178

    Hope this helps others intrested in platformers as well.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012