User Tag List

Results 1 to 6 of 6

Thread: Collision Detection with Slopes

  1. #1
    No Products Registered

    Join Date
    Feb 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Collision Detection with Slopes

    Hello there everyone,

    Been messing around with MMF2 for awhile now and finally decided on making something worthwhile (in my eyes anyway). A platformer.

    I'm currently redoing the engine for a Third time now. The first one was based off David N's fastloop tutorial on the main website. After leaving it for a long time, I came back and redid it, heavily modifying a "High Precision Movement Engine" by Retriever II (cleaning out the unused event and the like).

    This time, I'm still using Retriever II's engine concept, but Slope Detection is still stumping me. The main issue is when I want to jump onto a slope, when the active player comes close to the slope, the player is moved down horizontally to make contact with the "floor". But in doing so it loses it's momentum and the horizontal movement is jerked.

    Now the question, how do you treat slope detection? I added the second version of the engine so you can see for yourselves.
    Test Engine v2

    Of course in no way do I take any credit for the engine.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Detection with Slopes

    You ought to take a look at the old game Zeb.
    Working as fast as I can on Fusion 3

  3. #3
    No Products Registered

    Join Date
    Feb 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Detection with Slopes

    I hesitated at first to respond quickly, so I looked at Zeb more times, looking at the slope detection.

    It's nice and fluid, but also isn't variable, which is something I need. Zeb only dealt with 2x1 slopes, but I plan on using 1x1 and 2x1 slopes as well. Seeing as the detectors where only detecting for one set of slopes it makes things simple and you can code directly the movement patterns. With the added slopes, I'd have to add more detectors (which would make things messy).

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Detection with Slopes

    I put up an example of how to add ramps to my tutorial's platform movement here - http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Board=5&Number=52566

    The theory for most of them is probably much the same.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Detection with Slopes

    I'd use the 'rotating slope detector' trick, where you have detectors which actually rotate position until they're both on the ground (if one is touching the ground, but the other isn't, rotate them until they both are, then rotate the rest of the detectors to go with them so that your wall and floor detectors etc don't get stuck in the slope)... But then handling the X & Y movement based on the multiple directions can start to become complicated...

    It depends on how accurate you want your slopes to be. It's perfectly possible to use simple 45 degree slopes programmed and still have it function properly on all different angles of slope as it will alternate between them.

  6. #6
    No Products Registered

    Join Date
    Feb 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Detection with Slopes

    I've gutted out the Engine I modified before, and I'm still in the process of working out how it goes up different angles, apparently it has on the spot slope detection, meaning it will detect if its 1x2, 1x1 or 2x1 slopes and act accordingly. If anyone's interested I'll upload it. It's quite complex but it works exactly how I want/need it to.

    Of course it's not my work, it's Retriever II's.

Similar Threads

  1. Box collision detection problem
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th January 2013, 02:07 PM
  2. Possible bug in PMO collision detection
    By K1kk0z90 in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 4th August 2011, 01:56 PM
  3. détection collision
    By graboide in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th December 2010, 05:24 AM
  4. Precise collision detection...
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th July 2010, 04:00 AM
  5. Collision detection
    By Crash86 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 1st April 2007, 04:50 PM

Posting Permissions

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