Analog stick controls and collision

Get help using Construct 2

Post » Tue Sep 03, 2013 7:26 pm

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.
B
4
S
1
Posts: 2
Reputation: 279

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, PROxMTswatTR and 15 guests