Java game programming code