Basic snake game written in java