Author Topic: Integer velocities?  (Read 3041 times)

eric22222

  • Fanatic
  • ***
  • Posts: 177
    • View Profile
    • Eric Online
    • Email
Integer velocities?
« 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.

cbass

  • Expert
  • Regular
  • *****
  • Posts: 97
  • script this
    • View Profile
    • Squest RPG
Re: Integer velocities?
« Reply #1 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:
2.3
2.00003
1
0
-234324

whatever.