Scrolling Game Development Kit Forum

SGDK Version 1 => Script => Topic started by: eric22222 on 2006-10-13, 08:54:40 PM

Title: Integer velocities?
Post by: eric22222 on 2006-10-13, 08:54:40 PM
Well, I'm thinking about updating Bots, but I have a few scripting questions:
What I'd like to do is have the wheel-shaped sprite accelerate. So, my idea is to have the x velocity increase while left or right is held. My first question is this: does DX have to be an integer? If not, it would be very easy to make a formula that slowly climbed towards a set velocity.
If it does have to be an integer, I'll just work around it with a counter that increases the speed every nth frame.
Title: Re: Integer velocities?
Post by: cbass on 2006-10-13, 10:33:18 PM
dx and dy are a "single" type which is a 4 byte floating point I believe.  which means yes it can be fractions of an integer

So they can be: