I need this needle to rotate to the next number for every 1000 feet. Yen represents the feet(i name my varibles weird so people have hard time figuring out what they are, unfortunatly that includes me). The needle is on an altimeter, like a clock but with a zero instead of a twelve. Each of the numbers represent 1000 feet. This first code holder shows what the current code is. Its like a clock so its 22.5 degrees to the next number(rotating it on its z axis) Thx for the help
rem set anchor point
test:
rem load altimeter
make object plain 201,1,1
position object 201,2.7,1.9,4
lock object on 201
ghost object on 201
Load image "altimeter.bmp",201
Texture object 201,201
rem make start varibles
x#=350
y#=210
yen = 3
z#=-300
rem load plane
load object "planeinside.x",10
rem point camera at plane door
point camera 0,y#,0
rem rotate camera to proper position
rotate camera 0,180,0
rem scale object to the appropate size
scale object 10,200,150,200
rem load needle for altimeter
load object "needle.x",22
scale object 22,30,50,30
color object 22,0
rotate object 22,0,90,0
position object 22,2.67,1.92,4
lock object on 22
rem start sub loop
do
rem rotate needle
rem control camera with arrow keys
if upkey()=1
dive = 1
goto jump
endif
rem update character
if anit = 0
if y# <60000
y#=y#+240
yen = yen + 4
endif
if y# >60000 & y# <120000
y#=y#+60
yen = yen + 1
if y# =>120000 then anit = 1
endif
position object 1,x#,y#,z#
position object 10,0,y#-30,0
yrotate object 1,a#
endif
rem make plane descend
psycree:
if anit = 1
y#=y# - 120
yen = yen - 2
position object 1,x#,y#,z#
position object 10,0,y#-30,0
yrotate object 1,a#
if y# =< 200
dive = 0
y# = get ground height(1,x#,z#)
goto jump
endif
endif
rem print altitude
ink rgb(255,255,255),rgb(255,255,255)
text 385,122,"" + str$(yen) + "0"
rem if altitude right print go
if yen => 1200
ink rgb(0,255,0),rgb(0,255,0)
text 250,60,"Go"
endif
rem position camera to the back of the character
cx#=270
cz#=200
cy#=y#
position camera cx#,cy#,cz#
rem synchronize
sync
rem end sub loop
loop
rem screen settings
sync on
hide mouse
set camera range 1,95000
rem load and capture matrix graphics
load bitmap "skydive.bmp",1
get image 1,0,0,254,129
delete bitmap 1
rem create test character
make object sphere 1,100
rem load target object and move it
load object "target.x",20
scale object 20,20000,1000,20000
randomize 20000
position object 20,rnd(20000),5,rnd(20000)
xmove:
if object position x(20) < 500
anopos = object position z(20)
position object 20,rnd(20000),5,anopos
goto xmove
endif
zmove:
if object position z(20) < 500
anopos = object position x(20)
position object 20,anopos,5,rnd(20000)
goto zmove
endif
rem make the matrix
make matrix 1,10000,10000,25,25
rem make airplane(s) 4
load object "airpl004.x",5
scale object 5,7000,7000,7000
position object 5,4000,250,4000
rem prepare matrix with a texture cut into a 2x2 texture grid
prepare matrix texture 1,1,4,4
rem make sub matrixes so you can't see off to the side
make matrix 2,10000,10000,25,25
position matrix 2,-10000,0,0
prepare matrix texture 2,1,4,4
fill matrix 2,0.0,1
make matrix 3,10000,10000,25,25
position matrix 3,10000,0,0
prepare matrix texture 3,1,4,4
fill matrix 3,0.0,1
make matrix 4,10000,10000,25,25
position matrix 4,0,0,10000
prepare matrix texture 4,1,4,4
fill matrix 4,0.0,1
make matrix 5,10000,10000,25,25
position matrix 5,0,0,-10000
prepare matrix texture 5,1,4,4
fill matrix 5,0.0,1
make matrix 6,10000,10000,25,25
position matrix 6,-10000,0,-10000
prepare matrix texture 6,1,4,4
fill matrix 6,0.0,1
make matrix 7,10000,10000,25,25
position matrix 7,10000,0,-10000
prepare matrix texture 7,1,4,4
fill matrix 7,0.0,1
make matrix 8,10000,10000,25,25
position matrix 8,-10000,0,10000
prepare matrix texture 8,1,4,4
fill matrix 8,0.0,1
make matrix 9,10000,10000,25,25
position matrix 9,10000,0,10000
prepare matrix texture 9,1,4,4
fill matrix 9,0.0,1
rem fill matrix with first texture tile
fill matrix 1,0.0,1
rem make drop zone
for a = 0 to 24
set matrix tile 1,13,a,3
set matrix height 1,13,a,0
next a
for a = 0 to 24
set matrix tile 1,12,a,3
set matrix height 1,12,a,0
next a
for a = 0 to 24
set matrix tile 1,14,a,3
set matrix height 1,14,a,0
next a
set matrix tile 1,10,10,3
set matrix height 1,10,10,0
set matrix tile 1,11,10,3
set matrix height 1,11,10,0
set matrix tile 1,10,9,3
set matrix height 1,10,3,0
set matrix tile 1,11,9,3
set matrix height 1,11,9,0
for a = 6 to 14
set matrix tile 1,9,a,3
set matrix height 1,9,a,0
next a
for a = 6 to 14
set matrix tile 1,8,a,3
set matrix height 1,8,a,0
next a
for a = 6 to 14
set matrix tile 1,7,a,3
set matrix height 1,7,a,0
next a
for a = 6 to 14
set matrix tile 1,6,a,3
set matrix height 1,6,a,0
next a
update matrix 1
rem set start varibles
x#=500
z#=500
y#=0
dive = 0
rem start main loop
do
rem ////////////////////////////////////////////////////////////////////////
rem test dive fusion
rem if spacekey()=1 then dive = 1
rem ///////////////////////////////////////////////////////////////////////
rem set up plane collision
if object collision(1,5)>0 then dive = 1
rem control camera with arrow keys
if upkey()=1 then x#=newxvalue(x#,a#,15) : z#=newzvalue(z#,a#,15)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
if downkey()=1 then x#=newxvalue(x#,a#,-15) : z#=newzvalue(z#,a#,-15)
if shiftkey()=1 then goto test
rem stop player from going off world
if z#<-10000 then z# = z# + 20
if z#>20000 then z# = z# - 20
if x#<-10000 then x# = x# + 20
if x#>20000 then x# = x# - 20
rem update character
if dive = 0
y#=get ground height(1,x#,z#)+50.0
endif
if dive = 1 then goto dive
position object 1,x#,y#,z#
yrotate object 1,a#
rem position camera to the back of the character
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+200.0
position camera cx#,cy#,cz#
rem point camera at object
point camera x#,y#,z#
rem synchronize
sync
rem end main loop
loop
rem start to skydive
dive:
rem animate plain varibles
px = 4000
py = 250
pz = 4000
sp = 4
rem rid test character till needed
hide object 1
rem animate plain
repeat
rem go onto the runway
if dct = 0
px = px + sp
endif
rem switch to next step if in right position and no sticking to the step :)
if dct = 0 & px = 5300 then dct = 1
rem turn the plane around to the side SMOOTHLY(so much for the attempt)
if dct = 1
sp = 8
for x = 360 to 270 step -10
rotate object 5,0,x,0
rem pz = object position z(5)
rem px = object position x(5)
position object 5,px,py,pz
rem + 30
wait 100
next x
dct = 2
endif
rem make it go down the lesser side of the track to make the turn around
if dct = 2
sp = 8
pz = pz + sp
endif
position object 5,px,py,pz
rem switch motion varible at the end of matrix 1
if dct = 2 & pz >=9300 then dct = 3
rem make plane turn around agian(thx to damokles)
if dct = 3
for ax = 260 to 90 step -10
rotate object 5,0,ax,0
wait 100
next ax
dct = 5
endif
rem Final stretch on the land till jump WooHoo!
if dct = 5
sp = sp - 1
pz = pz + sp
py = py + 7
endif
position object 5,px,py,pz
rem position camera above the plane
if dct <5
cx#=newxvalue(px,wrapvalue(a#+300),300)
cz#=newzvalue(pz,wrapvalue(a#+300),300)
cy#=get ground height(1,px,pz)+2000.0
position camera cx#,cy#,cz#
endif
rem position camera on the plane
if dct =5
cx#=newxvalue(px,wrapvalue(a#-300),-2000)
cz#=newzvalue(pz,wrapvalue(a#+300),300)
cy#=get ground height(1,px,pz)+2000.0
position camera cx#,cy#,cz#
endif
rem make the switch to plane height animation
if pz =<-20000
dct = 6
endif
rem point camera at the plane
point camera px,py,pz
rem synchronise camera
sync
rem end if matches below
until dct = 6
rem hide airplane
hide object 5
rem show character
show object 1
rem set anchor point
test:
rem load altimeter
make object plain 201,1,1
position object 201,2.7,1.9,4
lock object on 201
ghost object on 201
Load image "altimeter.bmp",201
Texture object 201,201
rem make start varibles
x#=350
y#=210
yen = 3
z#=-300
rem load plane
load object "planeinside.x",10
rem point camera at plane door
point camera 0,y#,0
rem rotate camera to proper position
rotate camera 0,180,0
rem scale object to the appropate size
scale object 10,200,150,200
rem load needle for altimeter
load object "needle.x",22
scale object 22,30,50,30
color object 22,0
rotate object 22,0,90,0
position object 22,2.67,1.92,4
lock object on 22
rem start sub loop
do
rem rotate needle
rem control camera with arrow keys
if upkey()=1
dive = 1
goto jump
endif
rem update character
if anit = 0
if y# <60000
y#=y#+240
yen = yen + 4
endif
if y# >60000 & y# <120000
y#=y#+60
yen = yen + 1
if y# =>120000 then anit = 1
endif
position object 1,x#,y#,z#
position object 10,0,y#-30,0
yrotate object 1,a#
endif
rem make plane descend
psycree:
if anit = 1
y#=y# - 120
yen = yen - 2
position object 1,x#,y#,z#
position object 10,0,y#-30,0
yrotate object 1,a#
if y# =< 200
dive = 0
y# = get ground height(1,x#,z#)
goto jump
endif
endif
rem print altitude
ink rgb(255,255,255),rgb(255,255,255)
text 385,122,"" + str$(yen) + "0"
rem if altitude right print go
if yen => 1200
ink rgb(0,255,0),rgb(0,255,0)
text 250,60,"Go"
endif
rem position camera to the back of the character
cx#=270
cz#=200
cy#=y#
position camera cx#,cy#,cz#
rem synchronize
sync
rem end sub loop
loop
rem set anchor point
jump:
rem set dive varibles
rem y#=90000 will be equivalent to 15000 feet
x#=500
z#=500
fsp# = 30
fpd# = 0.1
dive = 1
rem set no reset end toggle anchor point
jjump:
rem check to see if altimeter exist
if object exist(30) = 1 then delete object 30
rem start sub loop
do
rem control dive with arrow keys
if dive = 1
if downkey()=1 then z#=newxvalue(z#,a#,-15) : z#=newzvalue(z#,a#,-15)
if upkey()=1 then z#=newxvalue(z#,a#,15) : z#=newzvalue(z#,a#,15)
if leftkey()=1 then x#=newxvalue(x#,a#,-15) : x#=newzvalue(x#,a#,-15)
if rightkey()=1 then x#=newxvalue(x#,a#,15) : x#=newzvalue(x#,a#,15)
endif
rem control character position with arrow keys
if dive = 0
if upkey()=1 then x#=newxvalue(x#,a#,15) : z#=newzvalue(z#,a#,15)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
endif
rem add parachute part for test
if spacekey()=1 & para = 0
para = 1
fpd# = 0.05
endif
if para = 1 & fsp >=20 then fsp# = fsp# - fpd#
rem add flare
if dive = 1
if inkey$() = "f" & para = 1 then goto flare
endif
rem stop player from going off world
if z#<-10000 then z# = z# + 50
if z#>20000 then z# = z# - 50
if x#<-10000 then x# = x# + 50
if x#>20000 then x# = x# - 50
rem stop fall if ontop of matrix & check to see if they die :)
compy# = get ground height(1,x#,z#)
if y# <= compy#
dive = 0
if corp = 0 then goto aregna
y# = compy#
endif
if corp = 1
if sarp = 1 then gosub hurah
endif
rem get rid of altimeter if on the ground
if dive = 0
if object exist(201)
delete object 201
endif
endif
rem slowly slow them down
if para = 1 & fsp# > 19 then fsp# = fsp# - 0.05
rem update characters position
if dive = 0
y#=get ground height(1,x#,z#)+50.0
endif
if dive = 1
y#=y#-fsp#
if para = 0 & fsp <= 100
fsp# = fsp# + 0.1
endif
endif
position object 1,x#,y#,z#
yrotate object 1,a#
rem position camera onside
if cy# >=2000
cx#=x#
cz#=z#
cy#=y#+200.0
position camera cx#,cy#,cz#
endif
rem position camera above charater if not falling
if cy# <=2000
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+200.0
position camera cx#,cy#,cz#
endif
rem point camera at object
point camera x#,y#,z#
rem make varibles show for tesing reasons
ink rgb(255,255,255),rgb(255,255,255)
set cursor 0,0
print x#
set cursor 0,20
print y#
set cursor 0,40
print z#
set cursor 0,60
print fsp#
rem synchronize
sync
rem end main loop
loop
rem flare animation
flare:
rem start flare sub loop
do
rem toggle off
if inkey$()="t" then goto jjump
rem if hit target get mushy
if object collision(1,20)>0
sarp = 1
endif
rem set a life death varibel
if fsp# <=25
corp = 1
endif
rem print the fall speed
set cursor 0,0
print fsp#
rem add camera movement
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=y#+200.0
position camera cx#,cy#,cz#
rem point camera at flaring person
point camera x#,y#,z#
rem stop fall if ontop of matrix
compy# = get ground height(1,x#,z#) + 30
if y# <= compy#
dive = 0
goto jump
endif
rem make character go foward
x#=newxvalue(x#,a#,10) : z#=newzvalue(z#,a#,10)
rem update characters position
y#=y#-fsp#/2
position object 1,x#,y#,z#
yrotate object 1,a#
rem steer character
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
rem synchronize
sync
rem end flare sub loop
loop
rem end part
aregna:
rem the your dead HAHAHAHA!!! animation
load animation "failed2.avi",1
play animation 1,0,0,680,500
wait 2000
delete animation 1
end
rem win part
hurah:
rem tell them good
load animation "congrat3.avi",1
play animation 1,0,0,680,500
wait 3000
delete animation 1
sarp = 0
corp = 0
dive = 0
return