anonymous
  • anonymous
is the following code good as a starting point for a snake game im woking on
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
package Snake2; import javax.swing.JLabel; import javax.swing.JPanel; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.Random; public class Snake extends JPanel implements KeyListener{ int [][] occupied=new int[50][50]; WALL=0,SNAKE=1,FOOD=2,COLLISION=3,NORTH=4,SOUTH=5,EAST=6,WEST=7;//the numbers that represent each number public static final int ROW_COUNT=50,COLUMN_COUNT=50;//dimension constants: occupied int level=1; int score=0; boolean gameOver=false; int [][] inintailPosition={{10,11},{10,12},{10,13},{10,14},{10,15}}; int [] xSnake= new int[2500];//{10,10,10,10,10,....} int[] ySnake= new int[2500];//{11,12,13,14,15,.....} int zSnake=5;//length of snake, max size is 50*50=2500 JLabel scoreBoard= new JLabel("Score: 0"); JLabel levelBoard= new JLabel("Level: 1"); JLabel spaceBoard= new JLabel("Press space for next level"); JLabel gameOverBoard=new JLabel("Game Over: Press Space"); random= new random(); }

Looking for something else?

Not the answer you are looking for? Search for more explanations.