Striker
Striker is a library I wrote for creating tile-based games (like Mario and Zelda). It's not under development any more, so feel free to take whatever you want from it. If you have any questions about it, please ask. I developed it with Allegro and gcc.
The Striker README follows:
Striker is in the public domain. That should settle any licensing/copyright issues. If anyone modifies it, however, I would like them to send me a copy, if only so I can see what they've done. Frankly, I don't care what people do with it. If someone wants to steal all the code and call it their own, they are only hurting themselves.
Striker is a tile map library. Right now it's only supported under Allegro, but eventually I'd like to see it ported to SDL and Clanlib (and whatever else there is).
Note: I stopped using DJGPP a few years ago, so I'm not sure if this actually builds with it anymore. Good luck. The instructions here will primarily be for Linux.
Note #2: Striker is incomplete. Much of it works -- most, in fact -- but there are still things missing. And there are some bugs. I don't have time to fix them; if you do, please send me your updates.
Installation
- 1. Type 'make'.
- 2. Su to root and type 'make install'.
- 3. Have fun.
Note: The files may somehow end up in DOS format; if this does indeed happen, run the 'fixunix.sh' script and it should fix them.
Also note that the makefile does not compile the utilities in the util/ directory. You'll have to compile these yourself -- use the "striker" shell script (see Use below) to do this. (E.g. type 'striker carto' and so on.) You'll then want to move all the executables to a directory in your PATH, probably /usr/local/bin.
Use
In the util/ directory there are three scripts. Two are Linux shell scripts ("striker" and "striker++") and one is a DOS batch file ("striker.bat"). All three take the name of the source file as their argument, without the extension. Example (the source file is testgame.c):
-
striker testgame
striker++ is for compiling C++ source, and it assumes the extension of the source file to be "cpp". This is of course a rather clunky way to do it; for any real project, a makefile system (autoconf or otherwise) would be much better. See the Project X makefile for more information. (Project X is on the Striker download page.)
Files
| data/ | various tilesets and fonts and such |
| lib/ | the compiled library ends up here |
| lua/ | test files for adding Lua script support to Striker |
| obj/ | the object files |
| src/ | the Striker library source files |
| test/ | various test programs |
| txt/ | text files including my logfile and a design document |
| util/ | utilities for use with Striker |
Creating a tileset
Create a series of images (preferably TGA) that you want in your tileset. They don't need to follow any specific naming scheme. Once you have these files, create a list with the filenames, one to each line (an easy way to do this in Linux is "ls -1 > tiles.lst"). Then run "buildts tiles.lst output.til". This will create a Striker tileset for use in map editing and whatever.Map editing
Open Carto. To load a tileset (which is the first thing you ought to do), hit 'T' and type in the filename. The rest should be fairly explanatory -- hit 'H' for help and you should be able to figure it out from there. If you can't, let me know and I'll write an extended tutorial.
Warning: you can't load a map before loading a tileset. (This may apply only to the first time within a Carto session, but I'm not sure.) So load the tileset first and then load the map.
Coding with Striker
I don't have time right now to write a tutorial on this, so you'll have to dive in yourself and look at the stuff in test/ and util/. txt/design.txt should also be a help. If you really can't figure it out, e-mail me.
The main things are to include striker.h and to link with the Striker library. Look at the util/striker scripts to see how to link with it.
Features
Here are some of the basic features of Striker. (There are more, but I don't have time to create an exhaustive list.)- Tilesets
- Static and animated tiles
- Attributes for each tile
- Multi-layer maps
- Sprite packs
- Font system
- Map editor (Carto)
- Tile ripper (ripts)
To-do
| * Fix Carto load bug | For some weird reason, you can't load the map before loading the tileset. This is a problem. :) |
| * Scripting support | I've attempted to do this through Lua, as you'll see in the lua/ subdirectory. I think it did work under Linux, but not under DJGPP. Your mileage may vary -- good luck. |
| * Finish tile mask support | This was intended for collision detection and that sort of thing. I'm not sure it's the best way to do it, but it's a nice idea. |
| * Add a delay for viewspr when cycling animated sprites | I originally wrote Striker on a 486, so it flips through sprite animations *way* too fast. |
| * Port to SDL and Clanlib | And any other graphics libraries you're interested in, frankly. Ideally Striker would be split into two levels -- the API and the graphics library interface. It shouldn't be *too* hard. |
| * Write a font viewer |

