I'm working on making a 2 player tank game.
Here is the code I currently have
Rem Project: Tank Arena
Rem Created: 1/18/2007 3:34:29 PM
Rem ***** Main Source File *****
rem basic settings
hide mouse
sync on : sync rate 60
sync : center text screen width()/2, screen height()/2,"Loading..." : sync
wait 3000
rem loading media
load object "Warrior.x",1 : load object "Warrior.x",2
load image "sandstone_T.bmp",1
rem making world
make matrix 1,3000,3000,10,10
prepare matrix texture 1,1,10,10
rem creating boundary lines
make object cube 3,50
make object cube 4,50
make object cube 5,50
make object cube 6,50
rem adjusting size and orientation of models
scale object 1,50,50,50
xrotate object 1,-90
yrotate object 1,45
scale object 2,50,50,50
xrotate object 2,-90
yrotate object 2,-135
scale object 3,4800,50,50
scale object 4,4800,50,50
scale object 5,50,50,4800
scale object 6,50,50,4800
rem positioning
position object 1,350,0,350
position object 2,2650,0,2650
position object 3,1500,0,300
position object 4,1500,0,2700
position object 5,300,0,1500
position object 6,2700,0,1500
rem making and editing cameras
make camera 1
set camera range 1,0,5000
set camera view 1,0,0,1024,384
set camera aspect 1,1.7
color backdrop 1,rgb(150,150,255)
position camera 1,object position x(1)-300,150,object position z(1)-300
point camera 1,object position x(1),object position y(1),object position z(1)
make camera 2
set camera range 2,0,5000
set camera view 2,0,384,1024,768
set camera aspect 2,1.7
color backdrop 2,rgb(150,150,255)
position camera 2,object position x(2)+300,150,object position z(2)+300
point camera 2,object position x(2),object position y(2),object position z(2)
rem main loop
do
rem setting player 1 and player 2 controls
if keystate(72) then move object down 1,5
if keystate(75) then yrotate object 1,object angle y(1)-2
if keystate(77) then yrotate object 1,object angle y(1)+2
if keystate(17) then move object down 2,5
if keystate(30) then yrotate object 2,object angle y(2)-2
if keystate(32) then yrotate object 2,object angle y(2)+2
rem setting camera to follow players
position camera 1,object position x(1)-300,150,object position z(1)-300
point camera 1,object position x(1),object position y(1),object position z(1)
position camera 2,object position x(2)+300,150,object position z(2)+300
point camera 2,object position x(2),object position y(2),object position z(2)
rem boundaries and physics
if object collision(1,2) then move object up 1,5 : move object up 2,5
if object collision(1,3) then move object up 1,5
if object collision(1,4) then move object up 1,5
if object collision(1,5) then move object up 1,5
if object collision(1,6) then move object up 1,5
rem updating screen
sync
rem end loop
loop
I can't get the boundary cubes to stop the tanks from going off into space. the tanks colide fine but the boundaries don't.
Also, Reguardless of where the tank is it always seems to go under the cubes and the player 2 tank.
Any help would be appreciated Thx!
I don't suffer from laziness... I enjoy every minute of it!