It doesn't seem to work... Here's my bullet code:
Rem the variables
bullettime = 0
bullettimestep = 0.015
EnergyF# = 50
angleF# = 90
cosangleF#=energyF#*cos(angleF#)
sinangleF#=energyF#*sin(angleF#)
gravity# = 1.8
Rem from here on is shooting code
if TimeToShoot = 1
if Mouseclick()=1 and BulletLife=0
Position object 3,Camera Position X(), Camera Position Y(), Camera Position Z()
Set object to camera orientation 3
BulletLife = 150
shooting = 1
Show object 3
timetoshoot = 0
timetomove = 1
movetime = 1000
timenow = 0
time = timer()
oldx = object position x(3)
oldy = object position y(3)
oldz = object position z(3)
Endif
endif
if shooting = 1 then gosub BulletMove
sync
loop
BulletMove:
Dec BulletLife
If BulletLife = 0 then hide object 3 : shooting = 0
bullettime = bullettime + 1
move object 3, 15
inc bullettime,0.003
tsqr#=bullettime*bullettime
xt#=cosangleF#*bullettime+oldz
yt#=sinangleF#*bullettime-(gravity#*tsqr#)/2+oldy
print oldx
print oldy
print oldz
print x
print z
print y
if object collision(3, 0)
bullettime = 0
hit = 1
if object collision(3, 0) = 10000
enemyhealth = enemyhealth - 1
if enemyhealth = 0 then Obj# = 10000 : DestroyEnemy(Obj#)
endif
position object 4, x, y, z
position light 1, x, y, z
set light range 1, 5000
color light 1, 255, 0, 0
set point light 1, X#, Y#, Z#
show light 1
position object 3, 30000, 30000, 30000
endif
if y < get ground height(1, x, z) + 0.5 and hit = 0 or x < 0 and hit = 0 or x > 1000 and hit = 0 or z < 0 and hit = 0 or z > 1000 and hit = 0
hit = 1
bullettime = 0
if x > 0 and x < 1000 and z > 0 and z < 1000
tilex = Int(x/tilewidth)
tilez = Int(z/tiledepth)
set matrix height 1, tilex, tilez, get matrix height(1, tilex, tilez) - 10
update matrix 1
endif
position object 4, x, y, z
position light 1, x, y, z
set light range 1, 5000
color light 1, 255, 0, 0
set point light 1, X#, Y#, Z#
show light 1
position object 3, 30000, 30000, 30000
endif
if hit = 1
if exploding < 10 and exploded = 0
scale object 4, exploding * 250, exploding * 250, exploding * 250
exploding = exploding + 1
scroll object texture 4, 10, 10
if exploding = 10 then exploded = 1
endif
if exploded = 1
scale object 4, exploding * 250, exploding * 250, exploding * 250
exploding = exploding - 1
scroll object texture 4, 10, 10
if exploding = 1
exploded = 0
position object 4, 30000, 30000, 30000
shooting = 0
bulletlife = 0
position object 3, 30000, 30000, 30000
hit = 0
hide light 1
endif
endif
return
endif
position object 3,object position x(3),yt#,xt#