Kana Blast
Jan 2, 2023I’ve been learning Japanese and wanted to drill kana. There are many tools/games out there that do this, but I thought it would be fun to write one.
The output of that effort is Kana Blast:
It’s lacking functionality (sorry mobile) and polish, but it’s mostly complete and can be used to drill the basic “50” Hiragana now. A Settings screen allows you to pick which kana you want to drill. On the Play screen a single kana falls from the top of the screen. You type the romanized characters for the displayed kana and press enter. If your entry matches, the kana disappears and you receive 10 points. If the entry doesn’t match, 20 points are deducted. After 25 kana, you are taken to a Game Over screen that shows your score.
Haxe
I wrote Kana Blast in Haxe. After some success using it for a canvas-based Game of Life, I thought it would be good for this.
Some things I like about Haxe:
The compiler is pretty fast. After playing with Rust and Crystal, this was nice.
Haxe’s Enums are descriminated unions that are exhaustively checked during pattern matching. I used these in F# first and like them for modeling data.
The output of the Haxe compiler to JS is pleasantly small. The following listing compiles to 422 bytes:
class Main {
static function main():Void {
js.Browser.window.console.log("Hello, world!");
}
}
The size of Kana Blast is 15 KB of JavaScript. A GopherJS version I wrote that only has the attract/intro screen done is 949 KB.
Haxe worked out very well for this project. I think I’ll continue using it for these types of web games.
#haxe #games #japanese