hey this i found in the code base like the first day i got darkbasic and its not mine so i cant take credit for it but i will help u here it is
Rem Hide the mouse
Hide mouse
Rem Make all the objects needed in the game
Make object box 1,1,3,0 : color object 1,rgb(255,0,0)
Make object box 2,1,3,0 : color object 2,rgb(255,0,0)
Make object sphere 3,1 : color object 3,rgb(0,255,0)
Rem Set up the camera so it looks 2D
Position camera 0,0,-10
Point camera 0,0,0
Rem Setup what the variables start as
ply1posx# = -7
ply2posx# = 7
Ballmove# = 0
sync on
Rem Enter the main loop
Do
Position object 3,ballx#,bally#,0
Rem Setup the differant areas of the paddles and what they do
If ballx# > ply2posx# - 1 and bally# < ply2pos# + 0.5 and bally# > ply2pos# - 0.5 Then ballmove# = 0
If ballx# < ply1posx# + 1 and bally# < ply1pos# + 0.5 and bally# > ply1pos# - 0.5 Then ballmove# = 1
If ballx# > ply2posx# - 1 and bally# < ply2pos# + 3.0 and bally# > ply2pos# + 0.5 Then ballmove# = 2
If ballx# < ply1posx# + 1 and bally# < ply1pos# + 3.0 and bally# > ply1pos# + 0.5 Then ballmove# = 3
If ballx# > ply2posx# - 1 and bally# < ply2pos# - 0.5 and bally# > ply2pos# - 3.0 Then ballmove# = 4
If ballx# < ply1posx# + 1 and bally# < ply1pos# - 0.5 and bally# > ply1pos# - 3.0 Then ballmove# = 5
Rem Setup the differant ball movements
If ballmove# = 2 and bally# > 5 Then ballmove# = 4
If ballmove# = 3 and bally# > 5 Then ballmove# = 5
If ballmove# = 4 and bally# < -5 Then ballmove# = 2
If ballmove# = 5 and bally# < -5 Then ballmove# = 3
If ballmove# = 1 Then ballx#=ballx# +0.05
If ballmove# = 0 Then ballx#=ballx# -0.05
If ballmove# = 2 Then ballx#=ballx# -0.05 : bally#=bally# + 0.05
If ballmove# = 3 Then ballx#=ballx# +0.05 : bally#=bally# + 0.05
If ballmove# = 4 Then ballx#=ballx# -0.05 : bally#=bally# - 0.05
If ballmove# = 5 Then ballx#=ballx# +0.05 : bally#=bally# - 0.05
Rem Setup Player 1 and Player 2 controlls
If upkey() = 1 and ply1pos# < 4 Then ply1pos#=ply1pos# + 0.05
If Downkey() = 1 and ply1pos# > -4 Then ply1pos#=ply1pos# - 0.05
If keystate(72) = 1 and ply2pos# < 4 Then ply2pos#=ply2pos# + 0.05
If keystate(80) = 1 and ply2pos# > -4 Then ply2pos#=ply2pos# - 0.05
Rem Setup what happens if someone scores a point
If ballx# < -8 Then Sleep 1000 : Ballx# = 0 : bally# = 0 : ballmove# = 0 : ply1pos# = 0 : ply2pos# = 0 : Ply2score# = ply2score# + 1
If ballx# > 8 Then Sleep 1000 : ballx# = 0 : bally# = 0 : ballmove# = 1 : ply1pos# = 0 : ply1pos# = 0 : Ply1score# = ply1score# + 1
Rem Tell DBPro where the paddles are on the screen
Position object 1,ply1posx#,ply1pos#,0
Position object 2,ply2posx#,ply2pos#,0
sync
Loop
its a 2 player pong game so there u go and its 2d cya later hope it helps u
crzy programer