Results 1 to 3 of 3
Thread: Game of snake problems
- 03-07-2012, 12:02 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 1
- Rep Power
- 0
Game of snake problems
I just started with programming Java, but I have some issues programming the game Snake.
I programmed a piece of software which has to move the a snake consisting of 3 pieces one step in a direction. The problem is it equals the coordinats even after the method has ended, can someone help me.
The code:The first three lines of the output look like:Java Code:void processMoving(String eventData){ if(eventData.equals("scherm verversen")){ afdrukkenCoordinateRow(snakeRow); for(int i=snakeRow.numbersInRow;i>0;i--){ Coordinate hulpCoordinaat=snakeRow.row[i-1]; snakeRow.row[i]=hulpCoordinaat; } printCoordinateRow(snakeRow); snakeRow.row[0].x+=1; snakeRow.row[0]=moveFrontOfSnake(snakeRow.row[0]); printCoordinateRow(snakeRow); } }
2,0 1,0 0,0 2,0 2,0 1,0 3,0 3,0 1,0
3,0 3,0 1,0 3,0 3,0 3,0 4,0 4,0 4,0
4,0 4,0 4,0 4,0 4,0 4,0 5,0 5,0 5,0
2,0 1,0 0,0 are the starting coordinates of the snake.Last edited by Norm; 03-07-2012 at 01:39 PM. Reason: added code tags
- 03-07-2012, 01:39 PM #2
Re: Game of snake problems
Can your explain what the values should be?The problem is it equals the coordinats
What variable are you talking about? There isn't enough code to understand the problem.
What does this problem have to do with a java applet?
- 03-07-2012, 06:48 PM #3
Similar Threads
-
Creating Snake Game: Few problems.
By Nickv17 in forum New To JavaReplies: 2Last Post: 01-21-2011, 04:59 AM -
Snake Game Applet
By Growler in forum Java AppletsReplies: 6Last Post: 07-11-2010, 02:47 PM -
Snake game in java
By freaky in forum New To JavaReplies: 5Last Post: 04-20-2010, 06:34 PM -
Snake Game
By mustachMan in forum New To JavaReplies: 2Last Post: 12-10-2009, 10:35 PM -
Snake game movement
By BeerMonkey in forum New To JavaReplies: 9Last Post: 11-27-2008, 12:48 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks