RevEng Posted September 20, 2015 Share Posted September 20, 2015 The easiest way to implement accurate thrust mechanics in 7800basic begins with using fixed-point numbers for the ship X,Y, and Dx,DY. Dx and DY can be thought of as velocity values, and each frame they get added to the ship's X and Y. e.g. X=X+DX:Y-Y+DY If the thrust system uses the cardinal joystick directions, you adjust the DX and DY values appropriately. e.g. if joy0up then DY=DY-0.10 If the thrust system use angles and a thrust button, then you need a sine/cosine table to adjust DX, DY appropriately with the ship's angle. Adding proper drag to a thrust system is a little more complicated. If you just subtract a constant # from DX and DY each frame, the damping will change direction weirdly when DX and DY are non-zero and DX<>DY. A proper damping system will reduce DX and DY in proportion to their magnitude. Or you can punt and skip the damping system, leaving it up to the user to reduce their own thrust. 1 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.