The engine uses pre-drawn low-resolution bitmaps as an input. Bitmaps consist of array of pixels which have certain color and X, Y position. Each level uses a grid where each cell contains one instance of "Block" class.
There are 11 types of blocks already defined inside the engine. Following list shows each block type as well as its description and color code in 24- bit RGB hexadecimal format:
- EMPTY [0x000000] (non-solid transparent block, like air)
- SOLID WALL [0xFFFFFF] (solid visible wall)
- PLAYER SPAWN [0xFFD800] (player will spawn on this position)
- GRASS SPRITE [0x1FD500] (simple grass sprite)
- WATER TILE [0x0000FF] (water floor tile with simple scrollable animation)
- WOODEN PATH [0x441515] (static wooden path floor texture)
- MONUMENT [0x00FFFF] (monument sprite with four orbiting orb sprites)
- DOWN LADDER TILE [0xFF0000] (static ladder floor tile, level switcher)
- UP LADDER TILE [0xFFFF00] (static ladder ceiling tile, level switcher)
- BANNER 1 [0xB200FF] (simple banner block type 1)
- BANNER 2 [0x6900FF] (simple banner block type 2)
Each block's color code has been chosen arbitrarily and its functionality is defined in "Block" class. Based on the given bitmap and its color distribution engine loads that level by iterating over each pixel in the bitmap and based on the pixel X, Y coordinate and color engine will place a certain block into to the game world.
I have already predefined two levels – Park level & Underground level. Each level showcases different engine rendering capabilities. Following figure below shows both Park and Underground level bitmaps with some highlighted block types:
![]() |
Bitmaps of both demo levels |
Additional levels can be added by drawing a new bitmap the same way as it is presented on the image above and by following the steps below:
- Place your new bitmap inside the "\Resources\" folder
- Create new class named "yourNewLevel.cs"
- Inherit all the properties from the "Level" class and add the base constructor call
- Override "Draw" method so that your new level can be drawn
- Create new instance of your level inside "Form1" class
- Call "Draw" function for your new level
Part 4: Drawing strategy in C#.NET & GDI+ <<< | >>> Part 6: Fundamental graphical operations