User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Simpliest way to do slope detection?

  1. #1
    No Products Registered

    Join Date
    Jun 2010
    Location
    Sutton, Surrey, UK
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simpliest way to do slope detection?

    Whats the simplest way to detect slopes and when the player jumps, it propells them in that way slightly depending on the angle? Thanks

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Simpliest way to do slope detection?

    Like in Sonic The Hedgehog?
    I've actually never attempted to do something like that combined with a simple platform movement (Unless you want a Sonic engine..). I'll give it a go.

  3. #3
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    California, USA
    Posts
    1,241
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Simpliest way to do slope detection?

    You could use hidden detectors (Active objects set as invisible)

    If the player jumps (presses Shift) + player is overlapping hidden object (named LEFT) set a player flag (such as Flag A) to ON.

    If player flag A is ON
    + every .2 second (can be any amount you like)
    set player X position to player X position -1

    Upon collision between player and platform object (slope), set player flag off.

    The same would used for the RIGHT hidden detectors except you would use a different flag and would add 1 to the X position.
    DT
    Special Projects Director

  4. #4
    No Products Registered

    Join Date
    Jun 2010
    Location
    Sutton, Surrey, UK
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simpliest way to do slope detection?

    Looki, I have experience and looked in-depth into an engine you may have heard of called "Sonic Worlds" which is the most closest and exact replica of Sonic The Hedgehog, I just never understood how the angle stuff worked when looking at it.

    DT, thats the exact thing I do at the moment lol! It just don't work so well when you have a curving slope or something, as you would need to create multiple sensors.

    If it helps. I have 2 hidden actives on each side of the player that always position onto the floor below the player, and if there is a slope, they stay on their separate heights, which was the 1st step to how "Sonic Worlds" done it. The rest involves retrieving the angle from making the 2 hidden sensors "Look at" eachother constantly, then using the angle value to figure out the COS and SIN to figure out the value to set the X and Y speed. Jesus thats a lot of work

  5. #5
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    California, USA
    Posts
    1,241
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Simpliest way to do slope detection?

    If you are trying to get that high of a percision then YES it will be a lot of work.
    DT
    Special Projects Director

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Simpliest way to do slope detection?

    I'm aware of Sonic Worlds and I just made a quick example which uses the same method.

    I admit that it's not very well executed/explained, but maybe it helps!

    http://clickteam.info/looki/Examples/Slope.mfa

  7. #7
    No Products Registered

    Join Date
    Jun 2010
    Location
    Sutton, Surrey, UK
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simpliest way to do slope detection?

    Nono! Thats perfect!! Thank you Looki, greatly appreciated
    And thanks DT for helping out too

  8. #8
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,537
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Simpliest way to do slope detection?

    There are 'easy ways'

    The only 'correct' way imo is to use an algorithm to find the normal angle of the slope of collision mask at any given point. And I developed a very nice algorithm for this for my latest project!

    Basically it involves finding the points where a circle of a given radius intersects the collision mask, then taking the angle between those two points +90 as the normal angle. It has a very good mean time performance because it can start at the previous normals.

    I was going to write an article on it when I got the time >_>

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simpliest way to do slope detection?

    The 'correct' way is to have vector collision data instead of bitmask...

  10. #10
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,537
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Simpliest way to do slope detection?

    but then you can't do spritework

    I have a game that can input custom levels where you simply draw the sprites, chop them into a tileset, and work with them. No vector or predefined surfaces needed! Thats the power of my happy algorithm

    I'll post it tonight

Page 1 of 2 1 2 LastLast

Similar Threads

  1. PMO Jump through slope
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 13th May 2011, 08:52 PM
  2. Fast Loops and Slope Detection
    By Ausomeman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th December 2010, 10:55 AM
  3. Slope Detective vol. 1
    By Mdsx in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 15th April 2010, 10:12 PM
  4. Slope Detection?
    By Raylax in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th April 2009, 01:19 PM
  5. Simpliest way to give all enemies Gravity/Physics?
    By Zenoff64 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd May 2008, 02:31 AM

Posting Permissions

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