pingjiang / rokon

Automatically exported from code.google.com/p/rokon
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

setTerminalSpeed and negative acceleration #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of Rokon are you using?

Trunk (2.0.3).

Please provide any additional information below.

Currently, setTerminalSpeed takes 2 values, one for X and one for Y. But that 
means the X is only capped on one end (say 40), so when you accelerate in the 
other way (with accelerateX(-10) for example) there's no limit to the speed 
increase. Ideally, the terminal speed value should be absolute, so it should 
apply to the negative value as well (since negative acceleration is just 
acceleration in the other direction).

Original issue reported on code.google.com by necrotic...@gmail.com on 8 Jul 2010 at 6:54

GoogleCodeExporter commented 9 years ago
Fairly reasonable, I'll look at it, 2.0.3 has to be released today - this might 
not be in it

Original comment by rtaylor205@gmail.com on 9 Jul 2010 at 10:36

GoogleCodeExporter commented 9 years ago
it's kind of a misspelling bug

if(useTerminalSpeedX && ((accelerationX > 0 && speedX > terminalSpeedX) || 
(accelerationX < 0 && speedY < terminalSpeedX)))

should be 

if(useTerminalSpeedX && ((accelerationX > 0 && speedX > terminalSpeedX) || 
(accelerationX < 0 && speedX < terminalSpeedX)))

in Sprite.java onUpdate()

Original comment by wuas...@gmail.com on 27 Jul 2010 at 2:26

GoogleCodeExporter commented 9 years ago
the code is in 2.0.3

Original comment by wuas...@gmail.com on 27 Jul 2010 at 2:27

GoogleCodeExporter commented 9 years ago

Original comment by rtaylor205@gmail.com on 16 Aug 2010 at 1:55