944,171 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 3495
  • Java RSS
Oct 18th, 2006
0

Please help me with a java terminal snake game

Expand Post »
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!
Similar Threads
Reputation Points: 21
Solved Threads: 2
Posting Whiz in Training
hexstar is offline Offline
212 posts
since Aug 2004
Oct 18th, 2006
0

Re: Please help me with a java terminal snake game

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
Reputation Points: 20
Solved Threads: 4
Junior Poster
cms271828 is offline Offline
123 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Pop up the text file
Next Thread in Java Forum Timeline: Arrays(Binay Search)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC