Classic snake game implemented in java