There was such nice game as Snake.
We made applet and you can play online now.
Game roles and the applet enter are placed at http://www.brigsoft.com/bsjavasnake
Get Java project, C++ project or Window exe version (all free) at http://www.brigsoft.com
Article about how it woks are published on the site too.
It includes exercises for students.