User Tag List

Results 1 to 3 of 3

Thread: Troubles in Fast Loops for movement !

  1. #1
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Nov 2013
    Location
    Lyon
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Troubles in Fast Loops for movement !

    Hi guys ! How you doing ?

    I'm making a platform engine for my new project ! In order to get proper pixel collisions detection, I'm making the X movement system through a Fast Loop called "move_left" (for left side) and "move_right" (for right side).

    But I also want to get sort of a deceleration of the speed when I release the joystick

    My "PLAYER" object have an alterable value called "X_SPEED".




    When I'm pressing Left + My "left_sensor" isn't overlapping any backdrop
    then
    Start loop "move_left"


    On loop "move_left" + "X_SPEED" is lower than -4 (the maximum speed)
    then
    sub 0.1 to "X_SPEED"


    On loop "move_left" + When I release the Joystic
    then
    Stop loop "move_left" + Start loop "deccel_left" (deceleration)


    On loop "deccel_left" + "X_SPEED" is lower than 0 (so you still have some speed to decelerate)
    then
    add 0.1 to "X_SPEED"

    Until "X_SPEED" = 0 and stop both loops "move_left" and "deccel_left"
    OR
    "sensor_left" is overlapping a backdrop the stop both loops as well


    I did the same thing for right side of the movement


    But here is my issue !

    When my sensor_left is overlapping a backdrop the "move_left" loop is shut down correctly but my PLAYER is doing anyway the deceleration thing like if the "deccel_left" loop has not been shutting down...

    So my PLAYER is still moving left and don't stop where the collision should be


    Don't know if I was clear enough for you ! If you want I can send you the file.

    I would higly appreciate your help guys !

    Thank for your time

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    If you want pixel-perfect collision detection (and avoid any possible "phasing" into objects),
    you'll have to move the sensor and check for overlap inside both of your loops, the movement one and the deceleration one
    since both move your player (even if I don't see the player movement code, I assume you move it left/right depending on move_speed?)

    On loop "move_left"
    >> set sensor at new X,Y position

    On loop "move_left"
    + sensor overlaps obstacle
    >> negate movement (add to speed if you were subtracting, and the other way around) / stop loop


    On loop "deccel_left"
    >> set sensor at new X,Y position

    On loop "deccel_left"
    + sensor overlaps obstacle
    >> negate movement / stop loop


    not exactly sure what you are doing though
    (i.e. do you already move the sensor inside the loop?
    how do you handle player movement?)
    a sample .mfa would help clearing things

  3. #3
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Nov 2013
    Location
    Lyon
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man this is brilliant I'm an idiot I did not put the sensor position on the loop ! ^^

    Before you reply I tried the Platform Mouvement Object which is quit good actualy... I'll try both solution and see what's work best for me.

    Thank you so much for the help man

Similar Threads

  1. Fast Loops & Enemy Movement problem. What's going on here?
    By jfisher446 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th April 2013, 03:06 PM
  2. Fast Loops vs Grouped Fast Loops vs ForEach
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th August 2010, 12:22 PM
  3. Help please (360 and fast loops)!
    By RealGameMaker in forum File Archive
    Replies: 3
    Last Post: 19th August 2009, 12:30 PM
  4. Stuck on fast loops in floating point movement.
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 29th July 2009, 04:54 AM
  5. Fast loops
    By BenMo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th December 2006, 09:13 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
  •