Hi, Im making a 3D Snake Game in DB Pro.
Its from a 2D View but its 3D.
Rem Project: Snake 3D
Rem Created: 15/01/2005 12:19:59
Rem ***** Main Source File *****
sync on
sync rate 60
t=1
for t=2 to 10
make object cube t,10
next t
make object cube 1,10
c=11
make object cube 11,10
position object 11,20,20,0
position camera 0,0,-200
do
rem Keybaord Input
if upkey() then snakedir=0
if downkey() then snakedir=2
if leftkey() then snakedir=3
if rightkey() then snakedir=1
rem Movement Coding
if snakedir=0 then move object up 1,0.8
if snakedir=2 then move object down 1,0.8
if snakedir=3 then move object left 1,0.8
if snakedir=1 then move object right 1,0.8
rem Collisions
if object position x(1)=object position x(11) and object position y(1)=object position y(11)
position object 11,rnd(200),rnd(200),0
length=length+1
endif
rem Snake Trail Control...[Need To Add Up To 10....]
rem Length 1
if length=1
POINT OBJECT 2, object position x(1), object position y(1), 0
MOVE OBJECT 2,0.65
endif
rem Length 2
if length=2
POINT OBJECT 2, object position x(1), object position y(1), 0
MOVE OBJECT 2,0.65
POINT OBJECT 3, object position x(1), object position y(1), 0
MOVE OBJECT 3,0.5
endif
sync
loop
I need help with the collision. I need someone to edit it so that when object 1 collides with object 11, object 11 gets moved to somewhere randomly on the x and y axis and 1 is added to the "length" variable.
I have tried this but it is not working. I have also tried the object collision (object1,object2) command.
Please Help!!!
>_0