| | |
Please help me with a java terminal snake game
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2004
Posts: 212
Reputation:
Solved Threads: 2
Hi, I would like to make a terminal (non gui, the dos texty type interface) snake game and have a general idea of what to do but would like some help with the following: how do I make the walls? and how do I catch the keyboard input to move the snake (preferrably would like to use the arrow keys such that up moves the snake up, left moves the snake left, right moves the snake right, and down moves the snake down)? Thanks!
The Digital Freeway, professional paid hosting starting at just $10 a month, 5GB disk space and 15GB bandwidth, we have free hosting too and all accounts are instantly activated
•
•
Join Date: Oct 2006
Posts: 101
Reputation:
Solved Threads: 4
Well before you answer those questions...
How are you gonna draw it?
If you use System.out.println(..) to print to screen, it just prints what you said, you can't update it.
You could keep redrawing the snake, but in your command prompt you wil just see a huge list of snakes as you scroll, and it would be very flashy when viewing it.
I would have a crack at GUI's.
It is difficult when you start, but its probably best to start with a JFrame and a JPanel, and try some graphics.
Try out my chess, might give some inspiration (or it might not).
http://www.colin-java.co.uk/JChess/index.htm
How are you gonna draw it?
If you use System.out.println(..) to print to screen, it just prints what you said, you can't update it.
You could keep redrawing the snake, but in your command prompt you wil just see a huge list of snakes as you scroll, and it would be very flashy when viewing it.
I would have a crack at GUI's.
It is difficult when you start, but its probably best to start with a JFrame and a JPanel, and try some graphics.
Try out my chess, might give some inspiration (or it might not).
http://www.colin-java.co.uk/JChess/index.htm
![]() |
Similar Threads
- Snake game with parameters and it wont work... (Pascal and Delphi)
- array problem in java "Snake game" (Java)
- Snake Game (Pascal and Delphi)
- [MERGED]can anybody help me with this problem; snake game (Java)
Other Threads in the Java Forum
- Previous Thread: Pop up the text file
- Next Thread: Arrays(Binay Search)
| Thread Tools | Search this Thread |
Tag cloud for Java
-xlint add android api applet application array arrays automation bi binary blackberry bluetooth chat class classes client code compile compiler component converter database digit draw eclipse equation error event exception fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying oracle page pearl print problem program programming project qt recursion scanner screen server set size sms sort spamblocker sql string swing system thread threads time tree variablebinding windows xor





