User Tag List

Results 1 to 5 of 5

Thread: Using a fast loop for collision detection

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Nov 2011
    Location
    Melbourne, Australia
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using a fast loop for collision detection

    Hey, I've been having a bit of difficulty using a fast loop to detect collision with an obstacle backdrop, so that the active object (with gravity) does not become imbedded in the backdrop (floor). I'm sure someone knows what i'm talking about since this is a common problem with platform games, anyway i can't figure out why my fastloop doesn't work, admittedly the code is a bit weird.

    It works like this:
    If object >=1 then set fast loop 0 to 1 (1 iteration i assume)
    if object collides with obstacle backdrop is true AND fast loop 0 is active, THEN set gravity of object to 0.

    The gravity is set and the object stops moving, BUT it does so a few pixels inside of the floor, meaning the fastloop is not executing before the onscreen position of the object is updated.
    Can someone who knows more about fast loops please explain to me where i have gone wrong.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Nov 2011
    Location
    Melbourne, Australia
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    does anyone have any suggestions?

  3. #3
    No Products Registered

    Join Date
    Jan 2017
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, I'm quite new here so my advice may not be great, but as you seem to be struggling for a response I'll try to help.

    So the wider problem is that the ball is falling towards a platform, and it falls so fast that on frame A it's just above the platform and on frame B it's embedded inside the platform.

    I think, though this is just a shot in the dark, that your problem is you're looking for the point the ball collides with the platform. I think you need to be looking for the point that the ball overlaps with the platform, then move it to a point where they're adjacent to each other and not overlapping. You could probably set up a fast loop, and on each iteration of the loop, move the ball backward a step until they don't overlap anymore.

    Someone might be here in a moment to say I'm really, really wrong, as I know this is a classic problem and I'm not quite at the level of dealing with it yet - but in my current understanding, this is what I'd do.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Nov 2011
    Location
    Melbourne, Australia
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply Nyushin.
    Yes actually I did have a fast loop that moved the object -1 pixel to position it "out" of the backdrop, but the re-positioning was visible to the eye (ie ie gradually moved upwards)
    instead of being "instant" as one would expect with a fastloop. This leads me to suspect that i'm executing the fastloops incorrectly somehow, yet they certainly are executing, i tested them by playing a sound effect while their running, it sounds terrible but it proves that they work.
    Does anyone have any other suggestions?

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Nov 2011
    Location
    Melbourne, Australia
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I solved the problem. I just changed the conditions so that if the active object was colliding with the background then the fast loop was executed, but if the object wasn't colliding with a background the fastloop was stopped. This seems to work. I dunno why i couldn't get it to work earlier, i think i had the conditions in the wrong order.

Similar Threads

  1. Game Of Life - Fast Loop = not that fast :)
    By bad_rick in forum Fusion 2.5
    Replies: 7
    Last Post: 20th June 2016, 07:36 PM
  2. Replies: 3
    Last Post: 8th April 2016, 08:11 PM
  3. Replies: 2
    Last Post: 27th May 2015, 02:00 PM
  4. fast loop and loop index
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th May 2010, 01:43 AM
  5. Fast loop within fast loop - platform game
    By Safe in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 16th April 2010, 07:38 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
  •