This article shows you the way of creating simple games with the AllegNet library.
AllegNet is a .net library for creating game using the power of the Allegro 4.2.0 library.
If you want to use the library, you must have the framework 2.0 installed.
Setp 1 : Installing the library
Download the needed library if you don't have it :
http://skorzec.com/allegnet/dl/needed.zip
You have to copy the files inside %windir%\system32 directory. If you already have the msvcr80.dll don't replace it.
Download the lastest version of the library :
http://www.skorzec.com/allegnet/dl/allegnet_0400_binary.zip
Unzip the files.
Setp 2 : Create a new project in visual studio 2005 express or other IDE of your choice.
Open VS 2005 and create a new c# console application.
Add reference to the file AllegNet.dll.
Step3 :Write the code
The following code is commented !!
/*Here you have all necessary using*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using AllegNet;
using System.Drawing;
namespace AllagroManaged.Exemples
{
class AllegNet_pal:API //The main class must herit of AllegNet.API class
{
static int Main()
{
//AllegNet has some functions and object to deal with images, blit sound, joystick
//You can use object like PALETTE to play with 256 color image
PALETTE palette = new PALETTE();
//An RGB structure. a palette is an array of 256 RGB structure
RGB temp;
int c;
//You can use Allegro_init function to initialize the library
if (Allegro_init() != 0)
return 1;
//You can use it to install Keyborad functionality
Install_keyboard();
//You can choose your screen resolution with Set_gfx_mode function and GFX_MODES enumerator
if (Set_gfx_mode(GFX_MODES.GFX_DIRECTX_WIN, 320, 240) != 0)
{
if (Set_gfx_mode(GFX_MODES.GFX_DIRECTX_WIN, 640, 480) != 0)
{


Join the conversation! Your thoughts help the community grow.