Im figuring out how to make that on following these pics:
<img src="http://i.imgur.com/mOlmr.png" border="0" />
<img src="http://i.imgur.com/zFVYz.png" border="0" />
A red circle moves as player and the blue square is a enemy
It shouldn't lose red sprite on screen while it's out of window
Would you help me?