Re: Snake game help? Programming Software Development by mike_2000_17 Snake game! That's funny, that was (almost) the first program … snake game S.O.S Programming Software Development by soka2oo7 …() { snake.length = 50; snake.head_x = 320; snake.head_y = 240; snake.head_dir = RIGHT; snake.tail_x = snake.head_x - snake.length; snake.tail_y = snake.head_y; snake.tail_dir = snake.head_dir; setcolor(LIGHTGREEN); line(snake.tail_x,snake.tail_y,snake Snake Speeds up after the Menu Programming Software Development by sirlink99 …y)); } if (previous.equals("left")){ snake.add (new Point (snake.lastElement().x + 10, snake.lastElement().y)); } if (previous.equals("up… + 10)); } if (previous.equals("down")){ snake.add (new Point (snake.lastElement().x, snake.lastElement().y - 10)); } snakeRectangle.add(new Rectangle ((int… Re: Snake Speeds up after the Menu Programming Software Development by sirlink99 … Rectangle highScore = new Rectangle (50,275,160,50); private snake snake; private Color campSel = Color.black; private Color fPSel = Color… Color.black; private Color hSSel = Color.black; public void startMenu (snake s){ snake = s; addMouseListener (this); addMouseMotionListener (this); repaint (); } public … Snake game (graphics.h) turbo c++ Programming Software Development by andyherebi … sndEt(); void sndCgt(); int test(); void score(); Snake(); Snake(Snake*); ~Snake(); }; Snake::Snake() { } Snake::~Snake() { } void Snake::checkEgg() { if((e1 == p1) &&… } twnkl++; } settextstyle(8,0,1); } } Snake::Snake(Snake *p) { *p=NULL; } void Snake::egg() { do {e1 = (rand() % 100)… Re: Snake Speeds up after the Menu Programming Software Development by sirlink99 when you are in game the "T" button on your keyboard returns you to the title screen or the snakeMenu code. After when you go into the same snake game option (Free Play - Color) the snake moves twice as fast. then if you repeat again then the snake moves even faster. I am wondering why this is happening and how I can fix the problem. Snake Game Programming Game Development by waxx … > 0; i--) { snake[i][0] = snake[i-1][0]; snake[i][1] = snake[i-1][1]; } x = snake[0][0]; y = snake[0][1]; if…(3500); break; } else { if((snake[0][0] == xFood) && (snake[0][1] == yFood)) { snake[snakeLength][0] = xFood; snake[snakeLength][1] = yFood; xFoodSave = xFood… Re: snake!!helppppp Programming Software Development by 3pid snake[j].row==maxrow)||(snake[j].row==1)||(snake[j].col==maxcol)||(snake[j].col==1)|| (snake[snake_length].row)==(snake[j].row) &&(snake[snake_length].col)==(snake…case(left_key) : snake[snake_length].row=snake[snake_length-1].row; snake[snake_length].col=snake[snake_length-1].col-1… Re: snake!!helppppp Programming Software Development by William Hemsworth … ( (snake[j].row == maxrow) || (snake[j].row == 1)|| (snake[j].col == maxcol) || (snake[j].col == 1)|| (snake[snake_length].row) == (snake[j].row) && (snake[snake_length].col) == (snake Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by dranoel23 … [] args) { SnakeGame snake = new SnakeGame(); snake.setSize(360, 240); snake.setTitle("SNAKE"); // centers the frame snake.setLocationRelativeTo(null); snake.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); snake.setVisible(true… Re: Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by dranoel23 …} } // class for the Snake Game public SnakeGame() { add(…snake = new SnakeGame(); snake.setSize(360, 450); snake.setTitle("SNAKE"); // centers the frame snake.setLocationRelativeTo(null); snake.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); snake Re: Snake game (graphics.h) turbo c++ Programming Software Development by nbaztec try changing the values of delay(int) in Snake::Move(); Re: Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by VernonDozier … here). Have a paint function in the Snake class that paints the snake by painting each coordinate in 2 above.…underlying part down, the animation is simply repainting that snake every time a timer fires or a thread finishes sleeping…. Start with just being able to move the snake around manually with your keyboard or buttons. Then you… Snake Game - Need help Programming Software Development by nickwl23 …' ') { map [Snake_PositionY [Snake.getLength()]] [Snake_PositionX [Snake.getLength()]] = ' '; Snake.Move(); } else if (next == '$') { Snake.setLength(Snake.length + 1); point… snake game help Programming Software Development by 01hmyoung …{ TileType[,] levelOne = new TileType[25, 80]; Snake player = new Snake(); // The player is stopped when we start the… return vec; } // Update the players position and check that the snake // hasn't hit a wall, itself, etc. // // Remove ths… Re: Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by VernonDozier …As of now, i do have the original snake icon as a drawImage figure. FillOval. Im saying… call to drawRect for each segment in the snake's body. Walls could be rectangles too. Again…needs to be a different color from the snake, which needs to be a different color …the concept is the same. Each time the snake moves or gets longer or a fruit appears… Re: Snake movement Programming Software Development by PeTo. snake body for(int i=snake.size()-1;i>0;i--) { snake[i].x=snake[i-1].x; snake[i].y=snake… 119 || input == (char) 87 || input == 72) { snake[0].y--; } // move down when press "S" …0; i<snake.size();i++) { gotoxy(snake[i].x,snake[i].y); cout<<snake[i].shape ;… snake start Programming Software Development by ronnieaka … java.awt.*; import java.awt.event.*; class snake extends Frame implements Runnable,KeyListener//ActionListener { Thread …=new Thread(); String s="####"//my snake,sc="";//for storing score int score… play = new Button("Play"); snake() {super("Snake by A.K"); setLayout(new BorderLayout());… Re: Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by dranoel23 well yeah. As of now, i do have the original snake icon as a drawImage figure. FillOval. Im saying to copy the rectangle to extned the body, do i keep calling the Graphics class, or is that possible? Re: Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by VernonDozier … does [ICODE]movingOn[/ICODE] represent? Is it true if the snake is moving, false otherwise? It seems to me that very… Re: Snake game...it's difficult. Need assistance to comlpete it in Simplest way Programming Software Development by dranoel23 … " if(movingOn)" and the "else" the snake is moving as it normally should. I also switched the… Re: Snake movement Programming Software Development by PeTo. … == (char) 83 || input == 80) { snake[0].y++; } // move right when press "… == (char) 68 || input == 77) { snake[0].x++; } // move left when press "…snake[i].x,snake[i].y); cout<<snake[i].shape ; } int a=snake.size()-1; gotoxy(snake[a].x,snake Re: snake start Programming Software Development by quuba … Runnable [CODE]import java.awt.*; import java.awt.event.*; class Snake extends Frame implements KeyListener {//ActionListener Thread t = new Thread(); String… label"); //Button play = new Button("Play"); Snake() { super("Snake by A.K"); setLayout(new BorderLayout()); add(l… Re: snake start Programming Software Development by quuba …;); Button play = new Button("Play"); Snake() { super("Snake by A.K"); setLayout(new BorderLayout()); add(…+ e); } } } public static void main(String a[]) { new Snake(); } }[/CODE] [URL="http://download.oracle.com/javase/tutorial/uiswing… Re: snake in java Programming Software Development by sirlink99 … are you going to make levels like in my snake game? [This](http://www.mediafire.com/download/ayx5j42r95qqzi4/…frame. Gets repainted from Main.java and repaints the snake Listeners.java - Holds the key listener which has …frame(Main.java). Changes variables to moves the snake Snake.java - holds the snake (a Vector or points) which then moves… Re: snake start Programming Software Development by ronnieaka i didn't understand why used repaint(), i only know that its used with applets..never used it outside it so please explain that and the snake is not moving, i wanted to know how to animate that using the thread, using sleep(), but instead now it only moves when i press the arrow key.. still an advance from my previous bug laden code snake game in java with swing Programming Software Development by Korhan hello guys, I have to implement a classic snake game with java in 3 days but I couldn't … have a source code or a useful tutorial for the snake game please let me know. My program will be a… little different from the classic snake game but I just need the basic codes which move… Re: Snake movement Programming Software Development by DeanMSands3 … loop). enum direction { UP, DOWN, RIGHT, LEFT}; direction=UP; //Start snake facing up. Now, direction does not change UNLESS the user… == 75) { direction=LEFT; } } And in every loop, we update the snake's location, based on **direction** REGARDLESS of whether a key… Snake...again...Snake movements Programming Software Development by dranoel23 Well, i have a problem with the snake in my problem... if it runs into the … this is the code that checks if the snake runs into itself: [code] snake =new Rectangle(snakeX, snakeY, 10, 10);…(i).intValue(), bodyY.get(i).intValue(), 10, 10); if(snake.intersects(body)) { System.out.println("Game Over >:-… Re: Snake movement Programming Software Development by PeTo. … input == 77) { x_s=x_s+i; gotoxy(x_s,y_s); PrintVector(snake); gotoxy(x_s-i,y_s); cout<<" "; } … 75) { x_s=x_s-i; gotoxy(x_s,y_s); PrintVector(snake); gotoxy(x_s+snake.size(),y_s); cout<<" "; } any …