http://zetcode.com/tutorials/javagamestutorial