when i started coding i thought i could do this without asking questions, but i dont know what is wrong, i have tried for over an hour to try and figure this out, this is my last resort to ask here..
I am making a ping pong thingy game. and i am having some issues with collision..
Here is my code so far :
Hide mouse
Autocam off
Sync on : sync rate 40
position camera 0,0,-20
#include Functions.dba
Gosub _Make_world
Rem declare some stuff
Playerturn#=1
load music "Game.mp3",1
loop music 1
Do
gosub _control_ball
Gosub _control_playerone
Gosub _control_collision
sync
Loop
_Make_world:
rem world
rem back
make object plain 1,100,100
rem make stuff
make object box 2,23,2,5
position object 2,0,8,0
color object 2,RGB(188,52,18)
make object box 3,23,2,5
position object 3,0,-8,0
color object 3,RGB(188,52,18)
rem players
Make object box 5,2,5,3
position object 5,-10,0,0
color object 5,RGB(55,35,171)
xrotate object 5,90
rem player 2
Make object box 4,2,5,3
position object 4,10,0,0
color object 4,RGB(55,35,171)
xrotate object 4,90
rem ball
make object sphere 6,2
position object 6,0,0,0
xrotate object 6,90
zrotate object 6,90
color object 6,0
rem set paddle collision to boxes
set object collision to boxes 5
set object collision to boxes 4
Return
_control_collision:
if object collision(4, 3)
position object 4,object position x(4),-5.7,object position z(4)
endif
if object collision(4, 2)
position object 4,object position x(4),5.7,object position z(4)
endif
return
_control_playerone:
rem up movement thingy
if upkey()=1
amoveup#=1
move object 4,-0.3
endif
if upkey()=0
amoveup#=0
endif
rem down movement thingyz
if downkey()=1
amovedown#=1
move object 4,0.3
endif
if downkey()=0
amovedown#=0
endif
return
_control_ball:
move object 6,0.1
if object hit(6, 4)
zrotate object 6,wrapvalue(object angle z(6)+180)
endif
if object hit(5, 6)
zrotate object 6,wrapvalue(object angle z(6)+180)
endif
return
i just started today so keep in mind i have not nearly finished the ball movement and that stuff

... i did not use any tutorials or stuff to make this code so it is noobish..
Well the problem i am having is that the ball only collides on one of the players.
Does anyone know why the ball only collides on one of the boxes, not both of them?
.zip file with all the stuff attached..

i like furry jesus and sódóma just more than anything else..