User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: Help with collision detectors in ISO environment

  1. #11
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    1,011
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by fredetmumu View Post
    this method is cool, but you can't go diagonally
    The diagonal movement should work fine in the .mfa I attached. Could you elaborate what doesn't work?

  2. #12
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    269
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    sorry it was because my poor french keypad don't work perfectly, your MFA is very fine and better than mine because very simple

    do you accept to share it on the french forum "le comptoir du clickeur"?


    https://lecomptoirduclickeur.fr/newsfeed

    if you are ok, i can post it and credit you

  3. #13
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    1,011
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Of course you can share it anywhere @fredetmumu

  4. #14
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    269
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    thank you!

  5. #15
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chrilley View Post
    Fastloops are great for this stuff. I've put in a basic movement for you. It moves the player by the X/Y Adjust values, you've setup, at a one-by-one pixel rate(within a fastloop so it's just as fast for us, mere mortals!). When the player hits an obstacle it will be pushed back out in the opposite X/Y value and stop the loop.
    Thank you this is just perfect! I am trying to understand the logic though for my own understanding. Why do the loop need to run the same amount of times as the X and Y Adjust? Also with this event "X( "Player1" ) + ( XAdjust( "Player1" ) / Abs(XAdjust( "Player1" )) )" Why is the XAdjust divided by itself? And also why do the X and Y adjust need to be reverted to 0 if detecting an overlap? (I actually tried to remove these reverting to 0 and it seemed to work as well without these events?)

  6. #16
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    1,011
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Sure!

    The fastloops run the amount of times equal to the pixels that you'd like to move. In this case it's 5 times and by putting abs() around it will ensure negative numbers like -5 turns into 5 instead, else walking left or up won't work since running fastloop -5 times means to run it 0 times.

    On each fastloop step we only want to move 1 pixel at a time per axis so if we divide the x/y adjust values by themselves you get either 1 or -1. Basically the x/y adjust values only serves to tell us what direction on the axis to move in. So for x adjust: 5/5 = 1(right) and -5/5 = -1(left). We use abs() again to make sure you don't divide a double negative and end up with a positive value by accident(-5/-5 = 1, so you'll end up going to the right even when you want to go left).

    And setting x/y adjust back to 0 just makes sure the fastloops doesn't needlessly re-trigger again until next key press. It's handy when you have acceleration/deceleration and such where if you let go of a key and the object keeps sliding forward and hits a wall or if you apply this movement to multiple objects and number of fastloops start adding up. It might not be that much applicable in this example like you point out though.

  7. #17
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chrilley View Post
    Sure!

    The fastloops run the amount of times equal to the pixels that you'd like to move. In this case it's 5 times and by putting abs() around it will ensure negative numbers like -5 turns into 5 instead, else walking left or up won't work since running fastloop -5 times means to run it 0 times.

    On each fastloop step we only want to move 1 pixel at a time per axis so if we divide the x/y adjust values by themselves you get either 1 or -1. Basically the x/y adjust values only serves to tell us what direction on the axis to move in. So for x adjust: 5/5 = 1(right) and -5/5 = -1(left). We use abs() again to make sure you don't divide a double negative and end up with a positive value by accident(-5/-5 = 1, so you'll end up going to the right even when you want to go left).

    And setting x/y adjust back to 0 just makes sure the fastloops doesn't needlessly re-trigger again until next key press. It's handy when you have acceleration/deceleration and such where if you let go of a key and the object keeps sliding forward and hits a wall or if you apply this movement to multiple objects and number of fastloops start adding up. It might not be that much applicable in this example like you point out though.
    Thank you for explaining, makes more sense now! However with the last thing with setting the x and y adjust back to 0 would that not cause bugs if indeed the character would slide forward and hit a wall? To me logically that would be the opposite of what should happen in that case and the engine will think that the character is standing still (x and y adjust at 0) while it might be sliding and need to still check collision? I might have missunderstood this though..

  8. #18
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    1,011
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I don't quite follow but there shouldn't be any buggy behavior afaik. Sliding next to a wall pretty much just means that the player is being moved on only one axis while the other is getting repeatedly cancelled every time it tries to start up; fastloop is called, player immediately moves into a wall, gets pushed back out, rinse and repeat.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Using Collision Mask For NPCs Instead Of Detectors
    By Progject in forum Fusion 2.5
    Replies: 1
    Last Post: 7th June 2018, 09:33 PM
  2. Dark Environment
    By NK0 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 14th April 2012, 01:30 PM
  3. Internal Collision Detectors
    By alxmrg in forum Hardware Accelerated Runtime
    Replies: 0
    Last Post: 13th February 2011, 06:16 PM
  4. Collision Detectors
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 28th July 2009, 09:04 PM
  5. Enemy Collision Detectors
    By Martin_Bodger in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 8th August 2008, 12:57 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
  •