[r135] Sprites speed up when hitting solid

0 favourites
  • 3 posts
From the Asset Store
2d mushroom sprite 2d game character enmy sprite game art
  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/122492/speedguy.capx

    Steps to reproduce:

    1. sprite with bullet function set to bounce off walls

    2. force sprite to slide on wall

    3.

    Observed result:

    speed increases greatly

    Expected result:

    speed does not increase

    Browsers affected:

    Chrome: yes/no

    Firefox: yes/no

    Internet Explorer: yes/no

    Operating system & service pack:

    Construct 2 version: r135

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing as won't fix. The bounce-off-solid code is pretty complicated, and in order to properly calculate the correct angle of reflection given the angle of the surface it's collided with, it's necessary to push it out a few extra pixels. Normally this is not noticeable since it only adjusts it for the one tick a collision happened. However your code forces the bullets in to the solid every tick, so the adjustment becomes an increase in speed. The 'Bounce off solids' is simply not designed for this, and you'd probably need to use the Physics behavior exclusively to properly simulate this type of interaction (including sliding, friction etc).

  • Sounds good, this just came up when I had some enemies that were floating, and one part of the level, the player ducked behind a ledge forcing the enemy to hit the ground.

    Wasn't sure if it was an easy fix or a big todo.

    Thanks!

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