Skip to content

A simple .Net game engine customized for the Raspberry Pi

Notifications You must be signed in to change notification settings

Captain-Coder/PiGameSharp

Repository files navigation

PiGameSharp
===========

I make a game for my children each year. Sofar it's been hack'n'slash by
writing to /dev/fb0, reading from /dev/js0 etc. It's time to up the performance
and cut down on the development cycle so I need a framework. I'm not an artist,
so to make my life simple (and my projects managable) I've decided to aim for
2D graphics. Pixel art preferably. Think Zelda, A link to the past, NES/SNES,
Day of the Tentacle, Mario and Starcraft, to name a few examples. I loved these
as a kid and I love making stuff. So why not make them for my kids. (Ok so my
art skills can make the best game look bad, but some things you just gotta
ignore. ^_^)

So for the technical side, I am very comfortable with C#. So I went looking for
a library that I liked that would allow me to do this from C#. But I found
mostly general 3D graphics libs that are too heavy for the PI, some others
targeting GLES, and wrappers around wrappers using some obscure lib. Did I
mention I wanted to stick to 2D, not 3D? Sure I can fake 2D graphics by using
textured quads, but the Pi also supports far more advanced 2D graphics through
OpenVG. There is little to no support for this framework on... any platform
really. (Do other developers know something that I don't when they decide not
to use OpenVG? Or is just everything 3D these days?) So I decided to do a quick
lib that would let me build the this year's game and get me in a good position
for next year. After dealing with DispManX, EGL and OpenVG I thought I might
aswell include evdev input and Alsa audio for a neat package.

This project can use two OpenVG implementations: 
- the Khronos Reference Implementation of OpenVG or
- the Broadcom OpenVG implementation on the Raspbery Pi.
Needless to say, the reference implementation (RI) is a slow software render,
but it works good enough to use on my development machine.

2018 update
===========
I worked on fixing the bugs left over from last year. The 2017 game is a simple
maze where you can collect fruit. This had a lot of code that could be
repurposed for the 2018 game. This is ofcourse the mark of code that should be
in a library somewhere. So I refactored the 2017 game and moved the
repurposable items to PiGameSharp. This was so successfull that the entire game
of 2017 now consists of only 3 classes for a total of 260 LOC including all
boilerplate, argument handling and maze layout definitions.

New additions to the library are:
- TileWorld, defines a game world consisting of square tiles. On which game 
entities can be freely positioned. The entities can interact with the tiles in
the world to create many effects. The object model should be flexible enough to
also describe other world geometries than orthogonal projection, such as
isometric, hexagonal or others. The code for this is definately not done yet :)
- Abstracted loadable resources. It just seemd like a good thing to do.
- Automated resource loader. Traverses the loaded assemblies and loads any
embedded resources from them.
- Resource cache. A cache structure that can automate unloading of infreqently
used resources. Currently it's not embedded very well in the resource use
cycle, just in the loading bit. So this will need future development to make
full use of it.
- Audio now also plays on Windows through some PlaySound magic
- VG Path. Limited initial work on exposing OpenVG Paths.

About

A simple .Net game engine customized for the Raspberry Pi

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages