rem make bullet
make object sphere 102,2
texture object 102,2
hide object 102
rem make monster explosion
make object sphere 130,20
texture object 130,2
ghost object on 130
hide object 130
make object sphere 131,20
texture object 131,2
ghost object on 131
hide object 131
rem load monsterperparticles
load image "fire.bmp",2
for x =1000 to 110
make object plain x+10,5,5
texture object x+10,2
set object x+10,1,0,0
ghost object on x+10
hide object x+10
next x
mpn=110
load 3dsound "bird.wav",102
load 3dsound "dog.wav",103
if monsterbulletlife > 0 then gosub monstershootbullet
if monsterexplode > 0
gosub monsterexploderocket
else
gosub monsterai
endif
rem simple monster missil
monsterai:
point object 3,x#,y#,z#
pdist=sqrt((mx# - x#)^2 + (MY#+25 - Y#)^2 + (MZ# - Z#)^2)
IF PDIST<1500
if monsterbulletlife=0 or monsterbulletlife < 500-pdist/10
point object 3,x#,y#-25,z#
position object 102,mx#,my#+25,mz#
set object to object orientation 102,3
monsterbulletlife =500
show object 102
loop sound 102
endif
endif
return
rem skyd monster skud
monstershootbullet:
dec monsterbulletlife
move object 102,12
mbx#=object position x(102)
mbx#=object position y(102)
mbx#=object position z(102)
inc mpn
if mpn=121 then mpn=110
scale object mpn,100,100,100
position object mpn,mbx#,mby#,mbz#
position sound 102,mbx#,mby#,mbz#
point object mpn,x#,y#,z#
zrotate object mpn,rnd(180)
show object mpn
for x = 1 to 10
scale object int((wrapvalue((mpn-9+x)*36))/36)+110,100+x*25,100+x*25,100+x*25
next x
if mby# < get ground height(1,mbx#,mbz#) then monsterbulletlife=0
pdist=sqrt((x# - mbx#)^2 + (z# - mbz#)^2)
if pdist<50
gosub placeplayer
monsterbulletlife = 0
endif
rem guided missile
if pdist <500 and pdist>250 then point object 102,x#,y#,z#
if pdist > 100 then point object 102,x#,y#,z#
hide object 102
stop sound 102
for x=110 to 120
hide object x
next x
monsterexplode = 20
return
rem explode monster bullet
monsterexploderocket:
position object 130,mbx#,mby#,mbz#
show object 130
position object 131,mbx#,mby#,mbz#
show object 131
escale=20*(30-monsterexplode)
scale object 130,escale,escale,escale
yrotate object 130,wrapvalue(monsterexplode*37)
scale object 131,escale/1.5,escale/1.5,escale/1.5
yrotate object 131,wrapvalue(359-monsterexplode*37)
dec monsterexplode
if monsterexplode = 0 then hide object 130: hide object 131
if monsterexplode=18
position sound 103,x#,y#,z#
play sound 103
endif
if monsterexplode < 15 then position sound 103,x#,y#,z#
return
here you go.....