0

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! :)

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by cms271828
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.