![Pow!](gifs/popbig.gif) |
PopcornA video game library for RISC OS |
What is it?
Popcorn is a library of routines written mostly in C to assist writers of video games for RISC OS. Included is a set of sprite plotting and tabling routines which will take the hard work out of writing traditional 'flat' video games. A consistent programmer's interface cuts development time, and you can finally enjoy writing games. Note that Popcorn is not designed to write Doom-style 3D games; for this try TAG, which is devloped by TBA software. With Popcorn, you can attempt anything from Space Invaders to Sonic the Hedgehog, and you'll be able to concentrate on game design rather than technicalities. I've based it heavily on Andy Southgate's excellent Gamesuite modules which do much the same job, but have not been updated in quite a while, and they use SWIs more suited to writing in BASIC or non-AOF ARM code.
To be honest, it's not all that complicated a library, totalling 60K of source so far, but it is pleasantly designed and does the job well. And I'll always be willing to accept new additions to the library, or add features on request.
![](gifs/pop.gif)
What can it do?
Clever tricks:
- A flexible object data structure, incorporating C++ style handlers for each object, many 'automatic' handlers, and limitless animation.
- Fast 8-bit only sprite plotter (faster than FastSpr in the case of small sprites)
- Particle handler, for stars, dust and so on.
- Prototypes which are defined and read in at run-time, to quickly create particular objects from templates without re-compilation of your code.
- Map files to arrange objects in patterns.
- Square-based collision checking between objects.
- Object velocities and gravity.
- Resource management, allowing for memory to be efficiently re-used by other objects not being displayed.
Cunning plans:
(in order of priority)
- Non-square based collision detection, so you can have irregularly shaped objects collision checked properly.
- Proper sliding heap memory management, rather than the crude mallocs currently used.
- Scalable sprite plotter; the data files for this plotter use sprite files which can compress to around a third of the original size.
- Re-coding of critical routines by hand for more speed. The library runs surprisingly well in C (on a StrongARM :-) ), though, so not a top priority.
![](gifs/pop.gif)
Downloading it
I've been left little time to improve Popcorn since the Acorn User release; I hope this release has no memory leaks left, after a brief going over with Dr. Smith's, though I can't make any guarantees. Also, there is no documentation to download except for a well-commented C header file. There are the Acorn User articles I wrote which will tell you how to get most out of the library; these are December '96, Christmas '96 and January '97 if you wantzi to order back issues. I'm working on a StrongHelp manual for it, and this will be available at some point when I've nothing better to do. A-levels are eating my time at the moment. If you need an example, take a look at Hive, the one weeny game I've written with the library, or !Gush, a demo which you can get below.
Since the Acorn User articles, Rik Griffin has taken some time to improve the library, add a dust handler and fix the library up slightly. It no longer relies on DeskLib and has a few more bugs fixed.
Popcorn 0.02 (44k)
- The latest version of the library, with source code included. 0.02 has some new additions such as a dust handler (Spheres of Chaos style) and support for scrolling landscapes. Obligatory bug fixes, code tidying etc.
Gush (18k)
- A small demonstration of most of Popcorn's facilities; it has some fairly neat, commented code to show you how to put together a game.
Spr2Pop
- A utility maintained by Rik Griffin for converting sprite files to Popcorn sprite data; it works as a command-line tool but has a desktop front-end as well.
-
![](../../gifs/blue.gif)
Feel free to email me on mattbee@soup-kitchen.demon.co.uk
![](../../gifs/blue.gif)