A community for students.
Here's the question you clicked on:
 0 viewing

This Question is Closed

JASdeep11
 2 years ago
Best ResponseYou've already chosen the best response.0package 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(); }
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.