1 overview
Tim Young edited this page 2017-10-01 23:34:16 +02:00

Overview

This is a simple graphics library for Windows Forms. It allows you to build simple games (2D, arcade style, types where you have numerous small things happening scattered around on the screen) in their simple infrastructure without needing to learn a lot of extra coding. Sadly, there is a bit of a different mindset needed to make an arcade-style game, with lots of things in motion simultaneously. So you will need to develop a different programming thought-process to handle dealing with time-based events.

The SpriteLibrary does not have code to work with joysticks or other controllers; there is nothing keeping you from making games that use those, but only the pieces for interacting with the mouse and keyboard have been built into SpriteLibrary. When I get a laptop with a touch-screen, I may update the code to work with that too. But for now, it is mainly just a keyboard / mouse thing.

I have continued to work on this code. It is more of a hobby for me, and it comes in waves when I get inspired. Please sign up to the releases email forum at: https://groups.google.com/forum/#!topic/spritelibrary That is the quickest way to be notified when I make enough changes to warrant a new release. I do semi-regularly fix things that remain in the development branch until they are stable, or I have enough of them to go through the effort of making an actual release.

Windows Forms have been around for quite some time, but it is still not very easy to make graphical games in WinForms. There are many complex libraries, and other systems for making games in, and using those extensive systems is how they recommend most people do their games. SpriteLibrary is a simple sprite engine for use within Windows Forms, with the intent of keeping things simple. While you can make a complete game with this library, it is not a very polished system in and of itself. It is mainly to get people started in graphical programming. Probably the first comment I will get from this is, "why not use a real gaming library?" The point of this library is for simple games, for an entry into graphical programming. After someone uses this, then they will probably build the desire to work with DirectX, OpenGL, XNA, Unity, etc.

This SpriteController class allows you to take a PictureBox and turn it into a gaming field. You give it a background to draw on, and then plunk your sprites on it. All the work of animating and moving the sprites is taken care of. It also contains a simple system for determining if keys have been pressed (since that is one of the big things that stymies fledgling programmers). You can use this library as an example for how to make your own sprite-controller, or use this one.

C# WinForms are not built to do complex graphics easily, but it does not take much to spark the interest of a fledgling programmer. And using a class like this is a fairly simple way to get started.