Bullet Behavior Bug

Bugs will be moved here once resolved.

» Thu Aug 04, 2016 3:12 am

Problem Description
Setting the bullet speed behaves more like a multiplier than a speed setting..

Attach a Capx

Description of Capx
When setting the bullet speed to something negative, it behaves erratically.

Steps to Reproduce Bug
• Open .capX.
• Run.
• Click on either button and watch its behavior.

Observed Result
When clicking the left arrow, multiple times, the bullet object switches directions, even though I am setting it to the same speed each time...

Expected Result
Setting a bullet speed should save as a constant variable, not a multiplier or whatever may be happening with this behavior

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

Operating System and Service Pack
Windows 10 Latest Service pack.

Construct 2 Version ID
r231
B
91
S
36
G
8
Posts: 313
Reputation: 11,886

» Thu Aug 04, 2016 3:25 am

So it's supposed to go negative speed?
Whats happening is that the behavior is designed to go by angles. Speed does not determine its direction.
As a default when you set the speed to a negative value it tells it to go the opposite direction.
When it goes the opposite direction it must have a positive speed, so that's what it uses.
Then when you tell it to go - speed it again thinks it's supposed to go the opposite direction.
B
178
S
50
G
205
Posts: 8,684
Reputation: 127,211

» Thu Aug 04, 2016 9:17 am

I see, I thought the variable would work like any other, negative speed would mean going in reverse of its current angle, as it already does, then setting it again to the exact same negative speed would keep it going in the same direction..like a constant....
B
91
S
36
G
8
Posts: 313
Reputation: 11,886

» Mon Aug 08, 2016 11:20 am

The Bullet behavior treats a "set speed" action as "calculate current angle then set magnitude of current movement at that angle". This has the effect of treating a negative speed as "point in the opposite direction then set a positive speed".

I agree it's a bit strange but I'm concerned about changing this since it could break existing projects that use that feature. It's also a pretty minor quirk IMO. So although the issue is probably valid, closing as won't fix.
Scirra Founder
B
414
S
245
G
92
Posts: 25,198
Reputation: 200,327

» Tue Aug 09, 2016 2:36 am

@Ashley Thanks for the honest feedback..
B
91
S
36
G
8
Posts: 313
Reputation: 11,886