Problems with Functions

BlitzPlus Forums/BlitzPlus Programming/Problems with Functions

first put your load player code in a function and put your main loop in a function and call load player and such in the function you call in the restart. the put run() [your main loop function] in at the end. heres an example

function run()
While Not KeyHit(1) 	
	Cls
	DrawLevel()
	TestInput()
	TestEnemy()
	TestCollision()
	Timer()
	DrawHUD()
Flip
Wend
end function
Function restart()
loadplayer()
loadenemy()
loadworld()
run()
endgame()
End Function