To address the life info text problem, all you need to do is use 'set cursor 0,0' in order to get them to print at the top left of the screen. I would suggest using:
text 0,0,"Lives: "+str$(lives)
text 0,20,"Health: "+str$(health)
Please do the following:
1. Always use a RETURN command at the end of a subroutine. You can make a do - loop in your subroutines and just use 'if spacekey()=1 then exit'. This will exit the do - loop cleanly and with a return command following, it will go back to the main program properly.
2. Indent your code. Most people will not help you if they have to sort through your code. Here is how I would indent your code (I made a couple of edits too)
`main program loop
do
`print life and health information
set cursor 0,0
print "Lives: ",lives
print "Health: ",health
`rotate jewels
yrotate object 16,wrapvalue(object angle y(16)-1.5)
`till death do us part...
if lives = 0 then gosub GO
if object collision(1,15) then health = health -100 : position object 1,0,10,15
if health =< 0 then lives = lives -1
if lives =< 0
health = 0
else
health = 100
endif
`make sure lives doesn't go beneath 0
if lives =< 0
lives =0
endif
`store old positions
oldposx#=object position x(1)
oldposy#=object position y(1)
oldposz#=object position z(1)
`controls
if upkey()=1 then move object 1,0.35
if downkey()=1 then move object 1,-0.35
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-2)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+2)
if spacekey()=1 and playergrav#=0 then playergrav#=0.35
if inkey$()="p" then gosub PAUSEMENU
if inkey$()="t" then position camera 0,25,0 : point camera 0,180,0
` get current object position
posx#=object position x(1)
posy#=object position y(1)
posz#=object position z(1)
` gravity
playergrav#=playergrav#-0.01
posy#=posy#+playergrav#
`sliding collision
position object 1,posx#,posy#,posz#
if object collision(1,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=-0.0
endif
`set size for controlled object
s#=object size y(1)/2.0
`ensure camera stays out of static boxes
if get static collision hit(oldposx#-s#,oldposy#-s#,oldposz#-s#,oldposx#+s#,oldposy#+s#,oldposz#+s#,posx#-s#,posy#-s#,posz#-s#,posx#+s#,posy#+s#,posz#+s#)=1
dec posx#,get static collision x()
dec posy#,get static collision y()
dec posz#,get static collision z()
if get static collision y()<>0.0 then playergrav#=0.0
endif
`update with new object position
position object 1,posx#,posy#,posz#
`camera
angle#=object angle y(1)
camdist#=5.5 : camhigh#=posy#+0.8 : camfade#=9.5
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
xrotate camera 10
`end loop
sync
loop
PAUSEMENU:
ink rgb(0,150,240),0
cls
set text font "Air" : set text size 30 : set text opaque
do
center text 520,250,"PAUSE"
center text 520,300,"PRESS SPACE TO CONTINUE"
if spacekey()=1 then exit
sync
loop
return
`game over menu
GO:
ink rgb(0,250,250),0
cls
set text font "Air" : set text size 50
do
center text 520,250,"GAME OVER"
if spacekey()=1 then gosub MENU : exit
sync
loop
return
3. Things that don't need to be repeated in every do - loop iteration should not be included in the do - loop. In your code, you set the text font and size each iteration and this will slow your program down considerably. You probably wouldn't notice it with this code, but someday you may code something that it will matter. Anyway, it is good programming practice to only have what you need inside the do - loop.
Hope this helps,
LB