Accelerated Movement Issue

  • Hello! This is the first time I've ever used this program, but I have had experience with other visual tools (the Fusion series, Game Maker, etc) which have helped in my understanding of many of the concepts used in Construct.

    What you see above is an attempt at creating a purely event-based movement engine with acceleration. The issue with it is that if you fiddle with the buttons while colliding with a wall, the moving object clips through a wall and moves to the other side. This only seems to happen when the player is holding right and pressing left at the same time. I have not had this happen with the left side.

    I assume it has something to do with how I'm adding the acceleration, but I'm not sure. Help would be great!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It probably has to do with using the XDir boolean. How about instead just check if Xacc is greater than or less than zero in your overlap events?

  • After setting this up,

    this oddity occurs.

    (I apologize for the weird visuals, I just grab random images from my hard drive as placeholders.)

  • I only looked quickly before. If the object is overlapping a wall then both your overlap events will run since you're not moving the object out of the wall. Consider if the object has a speed of 1 and hits a wall. The first overlap event sets the speed to -3, and the next event will set it back to 1. You don't get the same effect if the object moves to the left since only the second event runs.

    You could possibly solve it with sub events so only one or the other is run, not both. I used "speed" instead of "xacc".

    Sprite: is overlapping wall

    --- speed<0

    --- > add 4 to speed

    --- else

    --- speed>0

    --- > subtract 4 from speed

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