Posted Tue Sep 23, 2008 9:01 AM
You need to use multiple variables. One should be the status of the stick on the last frame (updated after the current stick's reading has been dealt with), another should be the duration that it's been identical to the current stick value (topping out at, say, 8 frames or so)...maybe resetting to zero when a stick direction change occurs. By using the latter, you can read a delta value from a table if you wish...but this does not solve the problem of handling decay. One way to approach this is rather than resetting the duration value to zero, reduce it instead.
Another approach is to use 2 variables instead of a duration...DX and DY. IIRC bBasic allows the use of signed floating-point variables, so you can use multiplication to increase the speed in any direction - as described before. The stick alters DX/DY, DX/DY alter X/Y. It's not much different than you already know how to change the sprite position...it's just done as a 2-step process. When the stick is not moved, use division to reduce both DX and DY.