So I've been playing around with PICO-8 for a few weeks now (I've got an Ultima I style game in progress, but that's slow going!). As part of that development, though, I've been putting together a framework based on the old XNA system of game components and the screen manager demo that was part of the XNA demos.
I decided to put together a simple video poker game to demonstrate/test/troubleshoot the framework, and this is the result of a few hours of playing around.
The idea is that there is are a handful of useful components that can be used to perform various utility functions (button handling, timer, etc) as well as a component called the screenhandler.
The screenhandler's job is to manage game screen objects that compartmentalize any aspect of the game that the user interacts with directly.
Basically, this means that instead of tracking game states throughout the code, I can create self-contained screens and pop them onto the screenhandler's stack. It controls what gets displayed and where input gets directed.
Screens can choose to be drawn (or not) when another screen is above them in the stack. The example here is that when the player pops up the betting window to alter the amount they are betting on a hand, the poker screen is still displayed behind it, even though it is not accepting any input from the player.
I'm using movAX13h's P8Coder, and you can download the .P8C file for the game from my blog at http://www.twentysidedblog.com/pico-poker/
(oh, and there is no sound, because I'm terrible with the sound effects editor...) :)
I'm using a modified version of YellowAfterlife's ord/chr code (though not used in PICO Poker) in my framework, but otherwise all of the code (and the terrible artwork!) is by me. Feel free to use it however you like.
I bought PICO-8 after I learned about it via PocketCHIP. I've been playing around with it for a couple of weeks now, and finally got started on my first real project. Just a GIF of the current state so far. I've been putting together the various components and systems I'm going to need to complete the game. So far, I've got:
Game Component system, including independent components for button handling, timing, and utilities. The whole game is handled via components. The _update() method is 2 lines. _init() and _draw() are 3 lines each. This system is actually based on XNA's game component design (I used to do quite a bit with XNA).
Screen Management system - This is one of my game components. It allows me to create separate code entities for various game states and determines which ones should be updated and drawn at any given time. Currently, I have the following screens implemented: splash screen (not in the GIF), title screen, character generation screen, text edit window, pop-up menu, world map screen, and town map screen. Several more still to implement.
Save/Load system - The title screen will check for valid save data and offer the "Journey Onward" option if present. I've got about 8 bytes left in my cartdata after accounting for character info, equipment, and story flags.
- Compressed map system - Towns and dungeons are stored as simple RLE compressed strings. All of the maps are stored as ascii drawings in a text file. I've put together a powershell script that reads the text file and generates LUA for pasting into the game to include the maps themselves and other data about the map (world location, name, encounters, etc).
I'm still working on a few of the base systems, including character sheet/inventory system, merchant screen, NPC dialog screen, the combat system, and the dungeon screen.