I'm creating a small 'battle arena' type game, and it's still very incomplete. The only problem so far is that the collision detection won't work. If you're wondering, yes, I read the tutorial again and again, it still doesn't work. Here's the code:
hide mouse
sync on
sync rate 30
load image "C:Program FilesDark Basic SoftwareDark Basicmediabitmapstexturesrealmetaldull01.bmp",3
load image "C:Program FilesDark Basic SoftwareDark Basicmediabitmapstexturesrealwallsbrick05.bmp",1
load image "C:Program FilesDark Basic SoftwareDark Basicmediabitmapstexturesarcademixedcotton02.bmp",2
make object box 1,70,100,200
position object 1,100,-100,100
set object collision to boxes 1
make object box 2,70,100,200
position object 2,-100,-100,100
make object box 3,1000,10,1000
make object sphere 4,20
set object collision to spheres 4
position object 4,0,-80,20
position object 3,0,-100,100
texture object 4,3
texture object 1,1
texture object 2,1
texture object 3,2
do
py# = object angle y(4)
if upkey()=1 then move camera 10
if downkey()=1 then move camera -10
if upkey()=1 then move object 4,10
if downkey()=1 then move object 4,-10
if leftkey()=1 then py#=wrapvalue(py#-5)
if rightkey()=1 then py#=wrapvalue(py#+5)
x#=object position x(4)
z#=object position z(4)
nx#=newxvalue(x#,py#-180,100)
nz#=newzvalue(z#,py#-180,100)
If Object collision(4,1)>0 then position object 4,x#,-80,z#
position camera nx#,100,nz#
point camera x#,20,z#
Yrotate object 4,py#
sync
loop
Please post an extension of the code explaining what I've done wrong.
If con is the oppostie of pro, then what is the opposite of progress?