Setting bullet speed to a negative value inverts the result

Bugs will be moved here once resolved.

Post » Tue Jun 30, 2015 12:02 am

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)
B
4
Posts: 5
Reputation: 210

Post » Tue Jun 30, 2015 5:26 am

drewerd wrote:Problem Description


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.



not a bug! ....
steps to fix it... click on your project object.. in the left side... on the object properties you have under bounce of solids set angle... if youl deselect that... your problem is solved :) Construct2 works like that from beginning! if u want ur angle of the character to change with the movement to be facing right direction u have to set its default angle to the first direction will move that is 180 having the set angle set to yes

i wold upload u the fixed capx.. but im using r208 ..
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Wed Jul 01, 2015 2:59 pm

Closing as won't fix: Construct 2 interprets setting a negative speed as setting a positive speed in the opposite direction. This is easy to work around, and trying to change how this works could break a lot of existing projects, so we'll leave it as is.
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Wed Jul 01, 2015 5:00 pm

It wasn't updating speed in the debugger, so thats a little buggy.
Image ImageImage
B
171
S
50
G
179
Posts: 8,390
Reputation: 113,474


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests