Woa! Why is your code indented like that? It looks very strange
Rem Make sphere
Rem Setup sync
Sync On
Sync Rate 60
Rem Make bullet
Make Object Sphere 2,50
Hide Object 2
scale object 2,100,100,100
Rem Make an enemy
Make object cube 3,100
scale object 3,50,100,50
Position object 3,100,0,100
Set object collision to boxes 3
Rem Make player
Make object sphere 10,50
Position object 10,-100,0,-100
Set object collision to spheres 10
Rem Main loop
Do
Rem Store Object angle Y in aY#
aY# = Object angle Y(10)
Rem Control input for camera
If Upkey()=1 then Move object 10,10
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)
rem make enemy health
set cursor 0,0
print enhealth
enhealth=100
rem fire the bullet
if controlkey()=1 and BulletLife=0
Position object 2,X#,Y#+40,Z#
Set object to camera orientation 2
BulletLife =25
show object 2
Endif
rem bullet life
If BulletLife > 0
Dec BulletLife
Move object 2,40
if BulletLife = 0 then Hide object 2
Endif
rem make the enemy health get taken away by the bullet
if object collision(3,2)=1
enhealth=enhealth-25
endif
rem make the enemy object disapear if its health reaches 0
if enhealth=0
hide object 3
endif
Rem Detect collision
If Object collision(10,0)>0 then position object 10,X#,0,Z#
Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,45,cZ#
Rem point the camera at the player object
Point camera X#,45,Z#
Rem Refresh Screen
Sync
Loop
Just what I thought, you put the enemy health inside the do-loop. Put it before the do command like this:
It is also best to print stats right before the sync.
Rem Make sphere
Rem Setup sync
Sync On
Sync Rate 60
Rem Make bullet
Make Object Sphere 2,50
Hide Object 2
scale object 2,100,100,100
Rem Make an enemy
Make object cube 3,100
scale object 3,50,100,50
Position object 3,100,0,100
Set object collision to boxes 3
Rem Make player
Make object sphere 10,50
Position object 10,-100,0,-100
Set object collision to spheres 10
enhealth=100 :`<<<<<<<
Rem Main loop
Do
Rem Store Object angle Y in aY#
aY# = Object angle Y(10)
Rem Control input for camera
If Upkey()=1 then Move object 10,10
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)
rem fire the bullet
if controlkey()=1 and BulletLife=0
Position object 2,X#,Y#+40,Z#
Set object to camera orientation 2
BulletLife =25
show object 2
Endif
rem bullet life
If BulletLife > 0
Dec BulletLife
Move object 2,40
if BulletLife = 0 then Hide object 2
Endif
rem make the enemy health get taken away by the bullet
if object collision(3,2)=1
enhealth=enhealth-25
endif
rem make the enemy object disapear if its health reaches 0
if enhealth=0
hide object 3
endif
Rem Detect collision
If Object collision(10,0)>0 then position object 10,X#,0,Z#
Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,45,cZ#
Rem point the camera at the player object
Point camera X#,45,Z#
rem make enemy health :`<<<<<<<<<
set cursor 0,0 :`<<<<<<<<<
print enhealth :`<<<<<<<
Rem Refresh Screen
Sync
Loop