he he oops.
i copy pasted from the wrong window
Heres the real code.
Rem Project: tanks
Rem Created: 5/21/2004 11:36:22 PM
Rem ***** Main Source File *****
sync on
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
type object
xpos as float
ypos as float
zpos as float
tangy as float
tangz as float
tangx as float
yang as float
endtype
type pin
w
a
s
d
up
down
left
right
space
endtype
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
gosub declare_stuff
gosub load_stuff
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
do
get_input()
move_player()
fire_stuff()
move_camera()
print_stuff()
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)
make object sphere 1000,1,2,2
`hide object 1000
return
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
declare_stuff:
global tank as object
global in as pin
return
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function move_player()
`EZro_Set OBJECT ANGLE X(1),OBJECT ANGLE Y(1),OBJECT ANGLE Z(1)
if in.right = 1 then tank.yang = wrapvalue(tank.yang+ 1)
if in.left = 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 in.up =1
tank.xpos = newxvalue(tank.xpos,tank.yang,.1)
tank.zpos = newzvalue(tank.zpos,tank.yang,.1)
endif
if in.down =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 in.a = 1 then EZro_Gy +1
if in.d = 1 then EZro_Gy -1
if in.w = 1 then EZro_Gx +1
if in.s = 1 then EZro_Gx -1
ROTATE OBJECT 3,EZro_GetX(),EZro_GetY(),EZro_GetZ()
endfunction
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function fire_stuff()
if in.space = 1
position object 1000,tank.xpos,tank.ypos,tank.zpos
set object to object orientation 1000,3
move object 1000,.1
`show object 1000
endif
endfunction
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function print_stuff()
set cursor 0,10
print "current key press : "; Scancode()
set cursor 0,20
print " x pos : "; tank.xpos
print " z pos : "; tank.zpos
endfunction
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function move_camera()
point camera tank.xpos,tank.ypos,tank.zpos : position camera tank.xpos-5,tank.ypos+50,tank.zpos-5
endfunction
`*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
function get_input()
rem w up
if scancode() = 17 : in.w = 1 :else : in.w = 0 : endif
rem w down
if scancode() = 31 : in.s = 1 : else : in.s = 0 : endif
rem a left
if scancode() = 30 : in.a = 1 : else : in.a = 0 : endif
rem d right
if scancode() = 31 : in.d = 1 : else : in.d = 0 : endif
rem space
if scancode() = 57 : in.space = 1 : else : in.space = 0 : endif
rem up
if upkey() = 1 : in.up = 1 : else : in.up = 0 : endif
rem down
if downkey() = 1 : in.down = 1 : else : in.down = 0 : endif
rem left
if leftkey() = 1 : in.left = 1 : else : in.left = 0 : endif
rem right
if rightkey() = 1 : in.right = 1 : else : in.right = 0 : endif
remstart
code for scancode in
if scancode()=
in. =1
else
in. =0
endif
remend
endfunction
IF your rolling along the ocean in you jet ski and the wheels fall off. Do you still have enough pancakes to cover a doghouse?
Purple, because icecream has no bones.