Spyral is a library/engine for developing 2D games in Python 2.X, with a focus on rapid development and clean design. Any system that runs Pygame should be able to run Spyral. Instead of
import pygame, you'll just use
import spyral instead.
Spyral was specifically designed for developing XO laptop games. Spyral's main source of documentation can be found at the Platipy project, which documents Spyral in the context of a university course for which it was developed. Visit the Platipy Project
What does Spyral offer?
- Scenes and Sprites : Scenes are stack-based containers for Sprites that make it easy to structure your game between different screens and levels.
- Views : Easily manipulate visual properties of collections of Sprites at the same time.
- Rects and Vec2Ds : Convenient container classes for managing two-tuples (think points) and four-tuples (think rectangles).
- Improved support for Images : No more fussing with Surfaces, just create Images (with a fluent interface!) and assign them.
- Animations : Animate properties of Sprites like the position, the image, visibility, or anything you need!
- Event handling : A sophisticated event delegator let's you register symbolic event names with functions, greatly enhancing the clarity of your code.
- Forms and Widgets : Need a button? Text input? Sophisticated tabbing? All our batteries are included!
- Concurrency (Actors) : Simple but incredibly powerful parallelism with a single MixIn - give each object it's own
- Styling : Separate out content from your code with Styling.
- Pythonic interface : We tried to make things fun and easy for you, the developer.
- Plus other goodies like Collision Handling, Layering, Game Clocks, and more!
- Greenlets (optional, if you want to use the powerful Actors feature for multi-processing)
- skel.py : A simple starting point for a new Spyral-based program, with a custom Scene. If you're not developing for the XO, this is a good starting point.
- events.py : Demonstration of registering keyboard and mouse events.
- fonts.py : Demonstration of a couple properties of fonts, and how to get text on the screen.
- forms.py : Demonstration of the Forms feature, including buttons and text inputs.
- style.py : Demonstration of using Style files to separate code from content.
- concurrent.py : Demonstration of the excellent Actors mixin, which allows quick and easy concurrency (requires greenlets). Press any key to step through it.
- cursors.py : Demosntration of the cursors presently supported in Spyral through Pygame. Press the left mouse button to step through them.
- collisions.py : Demonstration of two objects bouncing off each other.
- animations.py : Demonstration of the various kinds of Animations supported by Spyral. Use
Spaceto walk through the steps.
- view.py : Demonstration of the functionality of Views, which allow Sprites to be manipulated in groups. Use
Spaceto walk through the steps.
- minimal.py : The simplest possible Spyral program with no custom functionality. Not recommended, simply here to show off the simplicity.
- artifical_events.py : An example showing off how to mock events, or send out your own custom ones.