Uploaded June 2018 | Updated September 2026, 2 hours ago
The first steps into making a simple 2D game engine which I plan to use for my next series of games.
The player's movement has been updated to allow correctly for velocity, alongside other minor changes. I've also added in 10 circle-type objects - guess what the first game will be!
The next step will be to add in collision detection - first, on the border surrounding the "game area".
Future enhancements that I have in mind:
- Advanced collision detection
- Ability for player to shoot
- Objects can be destroyed / spawned
- Texture mapping
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!
The first steps into making a simple 2D game engine which I plan to use for my next series of games.
The player's movement has been updated to allow correctly for velocity, alongside other minor changes. I've also added in 10 circle-type objects - guess what the first game will be!
The next step will be to add in collision detection - first, on the border surrounding the "game area".
Future enhancements that I have in mind:
- Advanced collision detection
- Ability for player to shoot
- Objects can be destroyed / spawned
- Texture mapping
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!
![2D Game Engine in C++: [8] 2D Normal Maps
This video demonstrates 2D Normal Maps - a technique used to create directional lighting / shading based on the relative location of a LightSource to the drawn object in question. The end effect produces shading which gives even more of a 3D effect to the graphics engine.
The process that Ive used to do this is to create two versions of the tree sprite, one being the simple sprite, and another image (which I call the normal map) which is exactly the same as the original sprite, but with its red, green, and blue colours changed. These are changed to represent the intensity of light that should impact the sprite depending on the direction of the LightSource. These three colour channels represent horizontal (x-axis), vertical (y-axis) and depth (z-axis) coordinates respectively.
For example, a normal mapping of the sprite will have a red colour of 255 (the maximum) if the light intensity is brightest when a light is to the extreme right of the object. So, for the tree, this would be the right hand side of the tree trunk, and any right hand side of the individual leaves. The opposite can then be done for the left hand side of the tree. This gives a nice shading effect to the tree depending on where the light is coming from - although the lighting can be a bit blocky given that we are working on very low-res images!
I will release all code on GitHub once Ive finalised the engine - and have nice looking code to boot!
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili! 2D Game Engine in C++: [8] 2D Normal Maps](https://i.ytimg.com/vi/k-Z7wIuZfnA/mqdefault.jpg)
![2D Game Engine in C++: [5] Alpha Blending
This video illustrates an useful addition to the planes concept, that being alpha blending / transparency.
Critically, this will allow effects such as clouds in a top down / isometric game, see-through ghosts in a side-scrolling game, or smoke (as displayed here) in any type of game. It could also allow for effects such as creating see through areas of closer planes to make sure that the playing area is still visible.
I will release all code on GitHub once Ive finalised the engine - and have nice looking code to boot!
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili! 2D Game Engine in C++: [5] Alpha Blending](https://i.ytimg.com/vi/kF2RAxFV7qs/mqdefault.jpg)








