I have set up a key press to move an entity around my blitz project. I want to track (print to screen) the total distance the entity has traveled while the project is open. However I am having a bit of trouble with this. I have only been able to print the increment by which the entity is being moved. Can someone point out what I should be doing?
UPDATE:
I modified the code so that it moved rather than rotated
Graphics3D 640,480,16,2 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() cone=CreateCone( 32 ) PositionEntity cone,0,0,5 While Not KeyDown( 1 ) ; Reset turn values - otherwise, the cone will not stop turning! x#=0 y#=0 z#=0 ; Change movement values depending on the key pressed If KeyDown( 208 )=True Then x#=-1 If KeyDown( 200 )=True Then X#=1 If KeyDown( 203 )=True Then y#=-1 If KeyDown( 205 )=True Then y#=1 If KeyDown( 45 )=True Then z#=-1 If KeyDown( 44 )=True Then z#=1 ; Move sphere using movement values moveEntity cone,x#,y#,z# RenderWorld Text 0,0,"Use cursor/Z/X keys to turn cone" Text 0,20,"x: "+x# Text 0,40,"y: "+y# Text 0,60,"z: "+z# Flip Wend End
UPDATE:
I modified the code so that it moved rather than rotated