Problem Description
When setting the speed of a bullet object through an event, a negative value will invert the result when applied twice.
Attach a Capx
drive.google[DOT]com/file/d/0BwDq5BPaWAXyaWl3NUJqUVlaX00/view?usp=sharing
Description of Capx
Adds a sprite with a bullet behavior. When x is pressed the sprite moves to the left, when pressed again sprite will move to the right, and so on.
Steps to Reproduce Bug
- Open a new Empty Project
- Under Projects window Right Click on Object types, select insert new object
- Add keyboard
- Add a new Sprite
- Upload image or use pen tool to ensure it is visible in some way
- Under Sprite behaviors add bullet
- Set Speed to 200
- Set Initial State to Disabled
- In the event sheet add a new event
- Choose on key pressed, set to "X"
- Add action Sprite, Set Bullet speed to -200
- Add action Sprite, Set Bullet to enabled
- Run Layout
- Press X
- Observe that Sprite moves to the Left
- Press X
- Observe that Sprite now moves to the right
- Observe that pressing X multiple times will repeat this behavior
Observed Result
Sprite inverts it's direction when X is pressed.
Expected Result
Sprite should only move to the Left, repeatedly setting the speed to a negative number should not change the movement once the sprite is moving.
Affected Browsers
- Chrome: Yes
- FireFox: Yes
- Internet Explorer: Yes
Operating System and Service Pack
Windows 8.1 Pro
Construct 2 Version ID
Release 206 (64-bit)