Welcome to the community Thicker!
How much experience do you have using DBPRO?
There are a number of methods to make a spaceship fly; be it in 2D or 3D, but you may not understand the process if you have no experience with programming; which is not easy to tell with the information you have provided.
Let us know if you are creating a 2D or 3D game. The processes are similar in the sense that the position of your ship area represented as coordinates. In DBPRO we refer to these coordinates as X, for the horizontal (left to right) location; and Y for the vertical. When working in 3D, an additional dimension is used to represent the depth of a 3D location, which we called the Z axis.
Whether working in 2D or 3D, these positions can be accelerated using a speed, which is changed when a key is pressed. The DBPRO command;
KeyState() can be used to detect if a key is pressed; if so, the speed can be changed. The movement alters the X,Y & Z locations by adding or subtracting the speed from them.
If you are new; there is a library of tutorials on this forum which you can visit
here. You can also visit my banner at some point for additional tutorials after you have learned the basics.
Tutorial to look at:
Beginners Tutorial
Commands to look for in the Help documentation in your DBPRO code editor include:
[3D]
Position Object, Move Object
[2D]
Sprite, MoveSprite
Here is a simple example of code that moves a sprite that you'd have to create
` Set some constant values with our key codes. EG: The W key is code 17
#constant Key_W 17
#constant Key_S 31
#constant Key_A 30
#constant Key_D 32
` Give us the responsibility to refresh the display as close to 60 times per second as possible
Sync On : Sync Rate 60
` Set default settings
Acceleration# = 1.0
Angle# = 0.0
Speed# = 0.0
` Repeat the following between Do and Loop
Do
If KeyState(Key_W)
Inc Speed#, 1.0
Else
If KeyState(Key_S)
Dec Speed#, 1.0
Else
` Gradually change the speed to 1 as its constant speed
Speed# = CurveValue( 1.0, Speed#, 50 )
EndIf
` Limit the speed#
If Speed# < 1.0 Then Speed# = 1.0
If Speed# > 10.0 Then Speed# = 10.0
` The following could have been used with Matrix1 utilities.
` Speed# = Clamp( Speed#, 1.0, 10.0 )
` Turn the ship
If KeyState( Key_A )
Dec Angle#, 1.0
EndIf
If KeyState( Key_D )
Inc Angle#, 1.0
EndIf
` Limit the angle to 360 degrees
Angle# = WrapValue( Angle# )
Rotate Sprite Ship, Angle#
Move Sprite Ship, Speed#
Sync
Loop
There are more ways to do this, and you would need to load your ship sprite; which is a 2D graphic. But based on the example and what you learn in the linked tutorial, you should be able to work out how to do more with your ship.
In 3D, you change the commands from Move Sprite to Move Object & Rotate Sprite Angle to Rotate Object X_Angle#, Y_Angle#, Z_Angle#. You do not need to work with 3 angles if your ship can only rotate left or right; in which case the commands
Turn Object or
YRotate Object can do the trick without worry about the other two angles.
You have some work making the camera follow the object; using the
Set Camera To Follow command.
Link to
Matrix1 utilities