Hungry Snake

Recommended levellevel
5+
A long serpentine creature slithers across a limited field, obeying the player's orders (moving right, left, down, and up). And there's no way to stop it from moving. Just don't touch the boundaries or you'll die! And don't bite yourself or... well, you get the idea. Along the way, the creature encounters food that makes it even longer. As it grows, it gets more and more cramped... Stop the madness! You probably recognize this comedic storyline from the famous game "Snake". This game originated in the 1970s. That's when it first appeared on arcade machines. In the 21st century, it was popularized by Nokia, which pre-installed Snake on almost all their mobile phones. Between these two milestones, there were versions for the Commodore VIC-20, MS-DOS, ZX Spectrum, Windows, Mac OS… If you go to Google Play or the App Store, you'll probably find a couple dozen different versions of Snake. It's hard to imagine a platform that doesn't have its own version of Snake. Why? On the one hand, it's an interesting game that is perfect for passing the time. On the other hand, Snake is simple enough to create on your own. See for yourself! Use Java to write your own version of this game about the adventures of a growing reptile. On CodeGym, we've already described every step, which will help a novice player handle this task without problems. Carry on!
Comments (3)
  • Popular
  • New
  • Old
You must be signed in
shabarish kumarLevel 10 , Hyderabad
Saturday, 06:17
The draw(Game) method must be called on the created apple. Pass this to the method. it means as shown below only right.
Apple apple = new Apple(7,7);
        Game game = new Game();
        apple.draw(game);
Please correct me if I am wrong.
Wouter Van KerschaverLevel 5 , Oostende
day before yesterday, 16:31
both of these ways dont work for me ....
EwertonLevel 30 , Belo Horizonte
9 July, 19:35
Oh ****, I pressed reset on task 11, it goes back to 1 :(