EmuEngine

Nov 16, 2006

2 min read

C#

Windows

.NET

Visual-Studio

GDI+

Dev

Intermediate

WinForms

Author picture

by sniffi

Contributor

64k Views

3.51/ 5

Article image

Introduction

With the EmuEngine, you can create simple 2D games in C#, it’s a small library with the following classes:

With the EmuEngine, you can create simple 2D games in C#, it’s a small library with the following classes:

  • DrawingArea: This is the “main” class. It handles Picture objects, PictureWall objects, and PixelWall objects. It also includes a Collision function. Nothing more, but it’s enough for a simple 2D game like the test game in the sample project.
  • Picture: It represents a picture. The DrawingArea class has a function called AddPicture. With that function, you can add a picture into your game.
  • PictureWall: nearly the same as the Picture class. You can add a PictureWall object with the AddPictureWall function of the DrawingArea class into your game.
  • PixelWall: The constructor eats a Color, it’s a nice way to add a colored wall into your game.

The code of the test application in the project:

CS
  

It’s an easy way to code a game I think. All that you have to know is that your Form should have a Timer to check if any collision has happened and then call UpdateScreen() (redraws the scene).

Update

The Picture class got a new function named Catch(Picture target, int difficultLevel). With this function, you can easily add enemys, and the Paint function of your control is in the drawing area integrated, so you just have to call DrawingArea.UpdateScreen() in the TimerTick function to draw the new scene.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)