Here is my code
`Main Loop---------------------------------------------------------Main Loop
do
set cursor 10,10
print "Life = ";life#
set cursor 210,10
print "Attack Rating = ";ar#
set cursor 410,10
print "Defence = ";def#
`3rd Person setup
aY# = Object angle Y(1)
If Upkey()=1 then Move object 1,speed#
If Leftkey()=1 then Yrotate object 1,Wrapvalue(aY#-3)
If Rightkey()=1 then Yrotate object 1,Wrapvalue(aY#+3)
If downkey()=1 then Move object 1,0 - speed#
X# = Object position x(1)
Z# = Object position z(1)
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Position Camera cX#,100,cZ#
Point camera X#,50,Z#
`Collision with mapedge
If object position x(1) < 0 then position object 1,0,object position y(1),object position z(1)
If object position z(1) < 0 then position object 1,object position x(1),object position y(1),0
If object position x(1) > msize# then position object 1,msize#,object position y(1),object position z(1)
If object position z(1) > msize# then position object 1,object position x(1),object position y(1),msize#
`Combat with hostiles
If object collision (1,2) then position object 2,60,-50,60: combat()
Sync
loop
function combat()
ppx# = object position x(1)
ppz# = object position z(1)
ppa# = object angle y(1)
make matrix 2,100,100,5,5
position matrix 2,0,-55,0
prepare matrix texture 2,1,1,1
position object 1,40,-50,40
position camera 50,-30,-20
do
set cursor 10,10
print "Life = "; life#
set cursor 210,10
print "Attack Rating = "; ar#
set cursor 410,10
print "Defence = "; def#
set cursor 10,600
print "Enemy Life = ";life(2)
set cursor 210,600
print "Enemy Attack Rating = ";ar(2)
set cursor 410,600
print "Enemy Defence = ";def(2)
sync
loop
endfunction
I have problems with the flickering text (Life/Ar/Def) at the top of the screen and when it goes into the combat function.
Thanks in advance