Kasai!

TL;DR

kasai is a prototypal game system that allows implementing terminal games resembling handheld systems like Game & Watch and the like. If you’re younger than 40 you probably don’t know what I’m talking about.

Being… differently young, I have fond memories of playing with handheld games, mostly Game & Watch by Nintendo. I definitely remember playing with Fire, Mickey Mouse and Popeye, although I probably also put my hands on other ones or competing products (e.g. schiacciapensieri by Polistil).

It’s some time I’m playing with the idea, and some code, to re-create that kind of experience on the PC. This is the heart of my over-engineered project kasai (which should translate as fire from Japanese, hopefully), which I would currently define as a workable prototype.

Install and Run

You need some experience with Perl modules handling to install it; if you have the correct expertise, you should not have problems installing modules from the provided cpanfile/cpanfile.snapshot files. Otherwise… you’ll probably have to wait.

UPDATE see Installing Perl Modules.

The main script is of course kasai, make sure to include the path to the installed libraries and to the lib directory, like this:

$ cd games
$ perl -I ../lib -I ../local/lib/perl5 ../kasai

I know, I know… there’s a lot of additional smoothing work to do!

Game?

As of now, there is only a workable prototype of a game resembling Fire in its gameplay.

All mechanics elements should be available, i.e. the bouncing, the scoring and the counting of misses. The… only thing that makes it still a prototype is that there is still not that amazing sequence of little falling men as in the original game, I’ll have to think of a way to generate it in some intersting way.

Over-engineered?

The game Fire could have been implemented in much less code. I know for sure, even though I don’t really know if I would be able to. While programming the system, I had in mind other games too and tried to make things generic enough to easily add them.

One design goal is to possibly enable the definition of a new game only by declaring its characteristics in a YAML file, without need for code. I’m not 100% sure that this is the case, I’ll see in the coming weeks when I’ll try to define more games.

Games Definitions

Each game is defined by two files:

  • a game file with the generic and abstract mechanisms of the game, independent of how the game will be rendered

  • a user-interface definition which maps generic and abstracts elements of the game onto something that is displayed to the player. At the moment only Curses are supported, hence the only meaningful definitions for user-interfaces target the terminal.

Much more documentation will have to follow on how to write these game files… I don’t expect this project to be a success of any kind, but at least I’ll be able to add more games in the future if I have the right docs!

Any Feedback Is Appreciated

If you happen to give kasai a try please let me know! I would prefer constructive criticism, but even more blunt opinions will be welcome. Use the comments below or the GitHub repository, as you prefer. Until then… have a good time!


Comments? Octodon, , GitHub, Reddit, or drop me a line!