[r178] 8-Direction bug

Bugs will be moved here once resolved.

Post » Thu Aug 21, 2014 1:23 pm

Problem Description
8Direction adds a small Y-Vector positive movement(down) when going left at maximum speed. I thought that this is happening because of the smooth turning from other directions but this is applied even when the object continues its left-side route.

Attach a Capx
https://dl.dropboxusercontent.com/u/686 ... k_bug.capx

Description of Capx
In the capx there is a tank with an 8 Direction control scheme, using only 4 directions and with "Set angle: off". It has 4 looped animations (besides Default) for each of the directions(left, right, up and down) of movement 2 frames each. Animations are switched according to its Vector X and Vector Y readings, as it can be seen in the events.
Also the last event one causes the tank to spawn red particles when the bug appears (when the Left key is pressed AND Y Vector is greater then 0).

Steps to Reproduce Bug
  • Step 1: Run the capx
  • Step 2: Press left arrow and wait for the tank to accelerate to maximum speed

Observed Result
Tank changes its animation to left-moving once the it starts to move left, but when reaching its maximum speed frame changes to down-moving, because its Vector Y becomes greater then 0 with no apparent reason.

Expected Result
Tank Y Vector should not react to the left/right movements.

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
Windows 7 Home Edition SP1

Construct 2 Version ID
Release 178 (64bit)
Posts: 14
Reputation: 3,655

Post » Thu Aug 21, 2014 2:53 pm

It's basically just a tiny rounding error. See Common mis-used events and gotchas "Expecting math calculations to be exact". Just adjust your events to not work with zero, e.g. > 0.1 instead of > 0.
Scirra Founder
Posts: 24,249
Reputation: 192,240

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests