Speed > 0 while not moving.

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I was trying to make a condition:

    * While the player is climbing a ceiling, and his speed < 5, play the climbin_ceiling_standby animation;

    if not, play the climbin_ceiling_movement;

    for my surprise, if the player is not moving (stuck in a diagonal ceiling, for example) his speed is different of 0, instead of the real speed, it show the speed like when he is moving..

    So, I think something is wrong with his logic.. I did an old workaround to contour this issue with the jumping speed, setting his speed to 0 every time he stop for any reason (like jumping and sliding a wall after the jump) because his speed was keeping the same valor while sliding the wall and when he was realizing that pose, he was being shot of the wall, and not accelerating like in the normal way, so, when I reset his speed, he started to gain speed like in normal way.

    But now, I checked this thing again, and it's happening for everything.

    so, resuming, what need to happen:

    • Object not moving -> Speed like 0;

    What is happening:

    • Object not moving -> Speed accelerating like when moving, so, never like 0;

    How will impact my game:

    Many things, I want check when the player is really moving or not, even if the player is pressing to walk and hitting a wall, if it happen, the speed need to be 0, not the old walking speed, like is happening..

    So, the logic can go for much more things..

    The CAPX and the sample game are here:

    dl.dropbox.com/u/47035927/temp/SandBox-R024.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Please see how to report bugs - it can take hours for us to investigate projects with this many events, and often the conclusion is it is simply a mistake in the events and not a C2 bug. We can't possibly spare the time - please try to reproduce the problem in a minimal new project.

  • I was trying to reproduce it with boxes, and saw something what maybe is doing the speed different from 0 when in collision with a wall.

    It's straight related to the collision detection. When I have the time I'll work on it to see what's happening to show here.

    EDITED:

    Ashley, I found the cause.

    When you make a new sprite object, import frames of different sizes and edit it's collision box inside the editor, it'll keep the size of the first frame, and the collision box will set the percentage of this first collision box too.

    I found it accidentally after this issue: scirra.com/FORUM/shaking-screen-and-player-position_topic54555.html

    Where I started a new sprite and after loading the image inside the editor, it keeped the old size for the collision box. It explain why the hell on a standing animation the character is moving a very little bit, keeping the speed different from 0.

    Re-cheking my main project, where the player have a lot of animations, I detected some animations was imported with different sizes and after this, I just edited the images outside the software to maintain the same size of the very first frame, but when re-loading them, they keep the old size for the collision box, even thought showing the right coordinates on the editor.

    I solved it exporting the project in folder and editing all the files where this sizes and percentages are presents.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)