Shalin Shah

Greenhorn
+ Follow
since Apr 15, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shalin Shah

i am now not getting any run time error but frame is blank new code is:
11 years ago
after that i changed i++ in snake move methood to i-- which was my mistake but still i m getting problem as shown


Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 1
at java.util.LinkedList.checkElementIndex(LinkedList.java:553)
at java.util.LinkedList.get(LinkedList.java:474)
at snake.Snake.move(Snake.java:61)
at snake.Snake.make_snake(Snake.java:52)
at snake.Snake.<init>(Snake.java:34)
at snake.Snake.main(Snake.java:23)
11 years ago
ok then what should i do for black background as i said on blank frame setting the background doest'nt works wy my lat question i till unanswered...ye saw your post

means acctually i want to know how will i add the graphic object to frame as add methood takes component type of object.
11 years ago
no we are'nt in same class and acctually i want to make the background black but directly doing setBackground method does'nt do so why I dont know means in a blank frame when i set color of the background nothing happens so i made graphic object and when i set color then every object made using it will have that color so I did what actually happens can you tell me and what should I do to make this thing run..??
11 years ago
Hello guys,

Even I am having a problem with my snake game code and I am preety much not sure whether it is correct or not plzz help.

here's the code:
11 years ago