Problem Description
When moving an object "up" (270º) using the "move at angle" action, the final X position is not consistent. Sometimes you get a rounding error and some times not. The error is related to the initial X position of the object and the distance moved.
For some reason, moving the object "down" (90º), left (0º) or right (180º) doesn't seem to trigger the bug.
Steps to Reproduce Bug
- Run the project in the debugger
- See that the sprite's X position (after it has been moved 20 pixels) is 63.99999999999999. This is unexpected.
- Change the sprite's initial X position in the layout editor to 128
- Run the project in the debugger
- See that the sprite's X position (after it has been moved 20 pixels) is 128. This is correct.
- Change the sprite's initial X position in the layout editor back to 64
- Disable the second line and enable the first
- Run the project in the debugger
- See that the sprite's X position (after it has been moved 19 pixels) is 64. This is correct.
Observed Result
The final X position has a rounding error depending on distance moved and initial X position. The exact values that trigger the bug are somewhat arbitrary.
Expected Result
Since we're moving the sprite exactly 270º (that is, on the vertical axis), the X position should be unaffected.
Affected Browsers
Operating System and Service Pack
Windows 7 x64
Construct 2 Version ID
Construct 2 r166 64-bit