The Martin's Recent Forum Activity

  • If all you need is to map a number from range 0-255 to range 0-100, then just divide it by 2.55. To map it the other way, multiply it by 2.55.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Howdy.

    So, I have a player character I'd like to move with a gamepad analog stick, and a bunch of objects in my level that I'd like to collide with. The first part is easy enough -- my player sprite has a Bullet behaviour, and on every tick I set its angle and velocity according to the left analog stick. The problem arises when colliding with a Solid, because even though "Bounce off solids" is set to "Yes", the sprite happily sails through any walls in its way. (I assume it's because even if the sprite "bounces", the velocity changes get overriden on the very next frame.)

    I also tried adding a Custom movement to the player sprite and just have it Push out solid any time it collides. The problem with that is that I'm importing my solids from a tilemap, so the walls I'm colliding with are actually composed of many smaller blocks. What I think ends up happening is that the behaviour picks the wrong solid to push out of, and I get weird movement artifacts (player sprite accelerating or getting stuck in place when pushing against a wall, jittering in corners, or sometimes the sprite gets warped to the other side -- depending on which variant of Push out solid is chosen).

    I don't have these collision issues when using 8-direction movement, but that would defeat the entire purpose of the analog stick.

    If anyone came across the same issue and found a way around it, I'd much appreciate any advice.

The Martin's avatar

The Martin

Member since 3 Sep, 2013

None one is following The Martin yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies