dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] New console and a "Snake" game


From: Rhys Weatherley
Subject: [Pnet-developers] New console and a "Snake" game
Date: Thu, 06 Nov 2003 11:06:43 +1000
User-agent: KMail/1.4.3

Hi all!

I've added support for the upcoming "Whidbey" System.Console routines to 
Portable.NET, and I also wrote a simple "Snake" game that demonstrates how to 
use it.  The obligatory screenshot is here:

    http://www.southern-storm.com.au/download/snake.png

Currently, the extended console works on Unix systems.  I will be back-porting 
it to Win32 in the near future.  You will need to update both pnet and 
pnetlib from CVS as there were changes to both.

The Unix version uses "libtermcap" to obtain the terminal information that it 
needs to move the cursor, clear the screen, detect arrow keys, etc.  It also 
properly handles CTRL-Z suspensions, CTRL-C redirection, and terminal window 
resizing.

If the first method that you call is "Clear()", then it will put the terminal 
into the "alternative" mode used by "vi" and other curses-using programs.  
When the program exits, or is suspended, the original terminal contents will 
be restored.  If you call something other than "Clear()" first (e.g. 
"ReadKey()"), then it will assume that you want to use the terminal inline in 
a kind of "readline" mode.

See the definitions at the bottom of "runtime/System/Console.cs" for more 
information on the available methods and properties.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]