Posts

Showing posts from October, 2015

A Space Shooter in Curses

Image
Some of you who follow me may know that I have recently built a pretty nifty framework for working with terminals.  ANSI, ASCII, VT100, Windows Console, etc.  Its called Tcell , and located on github.  (Its a Go framework though.)  It offers many of the same features as curses, though it is most definitely not a clone of curses. Anyway, I decided it should be possible to write a game in this framework, so I wrote one. I give you Escape From Proxima 5 , a 2D multi-axis scrolling space shooter written entirely in Go, designed to operate in your text terminal The game is fairly primordial, but there is a playable level complete with enemies and hazards.   It's actually reasonably difficult to get past just this first level. Mostly the idea here is that you can get a sense of what the game engine is capable of, and see Tcell in action. As part of this, I wrote a pretty complete 2D game engine.  Its got rich sprite management with collision detection, ...

Fun with terminals, character sets, Unicode, and Go

Image
As part of my recent work on Tcell , I've recently added some pretty cool functionality for folks who want to have applications that can work reasonably in many different locales. For example, if your terminal is running in UTF-8, you can access a huge repertoire of glyphs / characters. But if you're running in a non-UTF-8 terminal, such as an older ISO 8859-1 (Latin1) or KOI8-R (Russian) locale, you might have problems.  Your terminal won't be able to display UTF-8, and your key strokes will probably be reported to the application using some 8-bit variant that is incompatible with UTF-8.  (For ASCII characters, everything will work, but if you want to enter a different character, like Я (Russian for "ya"), you're going to have difficulties. If you work on the console of your operating system, you probably have somewhere around 220 characters to play with.  You're going to miss some of those glyphs. Go of course works with UTF-8 natively.  Which ...

Tcell - Terminal functionality for Pure Go apps

Introducing Tcell  - Terminal functionality for Pure Go apps As part of the work I've done on govisor , I had a desire for rich terminal functionality so that I could build a portable curses-style management application. This turned out to be both easier and harder than I thought. Easier, because there was an implementation to start from --  termbox-go , but harder because that version wasn't portable to the OS I cared most about , and fell short in some ways that I felt were important.  (Specifically, reduced functionality for mice, colors, and Unicode.) This led me to create my own library; I've made some very very different design choices.  These design choices have let me both support more platforms (pretty much all POSIX platforms and Windows are included), increase support for a much richer set of terminals and terminal capabilities, etc. The work is called " Tcell " (for terminal cells, which is the unit we operate on -- if you don't like the...