this is a snake game implemented in java