Problem with my shooter code

Blitz3D Forums/Blitz3D Programming/Problem with my shooter code

Guy Fawkes(Posted 2012) [#1]
Can someone please tell me which line and why it's complaining that entity does not exist? I looked for it... the stupid debugger won't highlight the line that has the problem....





TomToad(Posted 2012) [#2]
The debugger on my version of Blitz3D highlights this line:
			Text GraphicsWidth()/2, GraphicsHeight()/2, "X: "+EntityX#(camera.tcamera\currentx#, True), 1, 1

Which is line 181.

camera.tcamera\currentx# is not an entity. I do believe you want camera.tcamera\camera instead. Or maybe you wanted to just use the camera.tcamera\currentx# field without the call to EntityX?


Guy Fawkes(Posted 2012) [#3]
Thanks alot, bro! :)


Guy Fawkes(Posted 2012) [#4]
Ok, 1 more small problem... Why does the text keep constantly writing more text to the screen? o.o






Floyd(Posted 2012) [#5]
A slight change to UpdateText will clarify this.

Function UpdateText()
Local c	
		
	For camera.tcamera = Each tcamera
		
		If camera.tcamera\camera<>0
				
			Text GraphicsWidth()/2, c + GraphicsHeight()/2, "X: "+camera.tcamera\currentx#, 1, 1
			Text GraphicsWidth()/2, c + GraphicsHeight()/2+20, "Y: "+camera.tcamera\currenty#, 1, 1
			Text GraphicsWidth()/2, c + GraphicsHeight()/2+40, "Z: "+camera.tcamera\currentz#, 1, 1
			
			c = c + 100
			
		EndIf
			
	Next
		
End Function



Guy Fawkes(Posted 2012) [#6]
Thanks for that! :)