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