I have decided to make a simple engine for a new game I'm working on, and now, I'm wondering: what are the essential features of a 2D game engine? Or, a game engine in general?
Add whatever your game needs. Not every engine needs every feature and I strongly recommend you to focus on the ones used by your game, if you ever want to finish working on it.
It's as easy to get lost in collecting engine features as it is to be frustrated later when figuring out that the gain of all this work turned out to be void because those engine features were never put to good use.
In general, I'd say that the following 2d engine components are quite common:
- Scene Management
- Resource Management
- Sprites, Tilemaps, Sprite Fields (probably combined with some kind of parallax layering technique or even "3d coordinates")
- Particle systems
- Sound / Music handling
- Input handling
- Collision detection / Physics
There aren't that many essential features for a game engine. It all depends on for what kind of game the engine is.
Well, the few features pretty much any 2D engine needs:
- Loading and displaying sprites (including animations)
- Loading and playing sounds
- Loading and playing music
- Rendering Text
- Resource Management (in a HTML 5/JS engine the browser takes care of this)
- Input handling
Everthing else really depends a lot on the kind of game the engine is made for. Particle effects might be useful for a action game, but maybe not so much for a strategy game. Same for physics. Some games work best with tile maps, while others may work better with some kind of polygon landscape or a landscape made of decals. Story heavy games need a proper way for handling cutscenes. A jump and run engine would need the functionality to handle slopes. etc. etc.