[r135] Sprites speed up when hitting solid

Bugs will be moved here once resolved.

Post » Tue Jun 25, 2013 4:05 am

Link to .capx file (required!):
https://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
    
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Tue Jun 25, 2013 11:48 am

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).
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Jun 25, 2013 5:03 pm

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!
B
30
S
10
G
7
Posts: 416
Reputation: 7,239


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests