basically what im trying to do is get the sphere to shoot in the same direction the cylinder is pointing. it doesnt want to work tho
Rem Project: tanks
Rem Created: 5/21/2004 11:36:22 PM
Rem ***** Main Source File *****
sync on
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
type object
obnum
xpos as float
ypos as float
zpos as float
tangy as float
tangz as float
tangx as float
yang as float
ammonum
ammotype
bullet
num
endtype
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
gosub declare_stuff
gosub load_stuff
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
do
print printkey : printkey = scancode()
move_cube()
fire_stuff()
point camera tank.xpos,tank.ypos,tank.zpos : position camera tank.xpos-5,tank.ypos+50,tank.zpos-5
sync : loop
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
load_stuff:
make object box 1,3,1,5
make object cylinder 3,2
position object 3,0,2,0
color object 3,rgb(30,30,30)
return
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
declare_stuff:
global tank as object
dim pbullet(100)
tank.ammonum = 99999
tank.bullet = 300
return
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function move_cube()
`EZro_Set OBJECT ANGLE X(1),OBJECT ANGLE Y(1),OBJECT ANGLE Z(1)
if rightkey() =1 then tank.yang = wrapvalue(tank.yang+ 1)
if leftkey() =1 then tank.yang = wrapvalue(tank.yang- 1)
`ROTATE OBJECT 1,EZro_GetX(),EZro_GetY(),EZro_GetZ()
rotate object 1,0,tank.yang,0
if upkey() =1
tank.xpos = newxvalue(tank.xpos,tank.yang,.1)
tank.zpos = newzvalue(tank.zpos,tank.yang,.1)
endif
if downkey() =1
tank.xpos = newxvalue(tank.xpos,tank.yang,-.1)
tank.zpos = newzvalue(tank.zpos,tank.yang,-.1)
endif
position object 1,tank.xpos,tank.ypos,tank.zpos
position object 3,tank.xpos,tank.ypos+2,tank.zpos
EZro_Set OBJECT ANGLE X(3),OBJECT ANGLE Y(3),OBJECT ANGLE Z(3)
if scancode()= 30 then EZro_Gy +1
if scancode()= 32 then EZro_Gy -1
if scancode()= 17 then EZro_Gx +1
if scancode()= 31 then EZro_Gx -1
ROTATE OBJECT 3,EZro_GetX(),EZro_GetY(),EZro_GetZ()
endfunction
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function fire_stuff()
if scancode()= 57
if tank.ammonum >= 1
if pbullet(100)=1
for i = 1 to 100
pbullet(i)=0
delete object i+300
next i
tank.bullet = 300
tank.num = 1
else
tank.bullet = tank.bullet + 1
tank.num = tank.num + 1
make object sphere tank.bullet,1
position object tank.bullet,tank.xpos,tank.ypos+2,tank.zpos
rotate object tank.bullet,object angle x(3),object angle y(3),object angle z(3)
move object tank.bullet,.1
pbullet(num) = 1
endif
endif
tank.ammonum = tank.ammonum -1
endif
endfunction
DANGIT NEO, YOU CHANGED THE CODE AND NOW THE MATRIX WONT TEXTURE RIGHT.