Here's a little game I made using a Game Engine I coded from scratch (with the help of a lecture, see below), using the SMFL graphics library.
Briefly, you are a certain shape and you have to destroy other differents shapes without being touched by these last, this with the help of two different weapons in order to obtain the best score.
This project is built and configured with CMake in case you would like to clone it.
Lastly, an entire majority of the game's settings are adjustable via the config.txt file, excecpt for the special Weapon that can uniquely me modified directly in the game.cpp file in the same name fonctions.
- The player is represented by a shape which is defined in the config file
- The player must spwan in the center of the screen at the beginning of the game, and after it dies (collides with enemy)
- The player moves by a speed read from the config file in these directions:
Up -> "Z" key, Left-> "Q" key, Right-> "D" and Down-> "S" key. - The player is confined to move only within the bounds of the window
- The player will shoot a bullet toward the mouse pointer when the left mouse button is clicked. The speeed, size and lipespan of the bullets are read from the config file.
You are free to come up with your own 'special move' which is fired by the player when the right mouse button is clicked. This special ability must:
- Multiple entities (bullets etc) spawned by special weapon
- Entities have some unique graphic associate with them
- A unique game mechanic is introduced via a new component
- A 'cooldown timer' must be implemented for the special weapon The properties of the special move are not in the config file.
- Ennemies will spawn in a random location on the screen every X frames, where X is defined in the configuration file.
- Enemies must not overlap the sides of the screen at the time of spawn.
- Ennemies shapes have random number of vertices, between a given minimum and maximum number, which is specified in the config file.
- Enemy shape radius will be specified in the config file.
- Enemies will be given a random color upon spwaning.
- Enemies will be given a random speed upon spwaning, between a minimum and maximum number, which is specified in the configuration file.
- When an enemy reaches the edge of the window, it should bounce off in the opposite direction at the same speed. When (large) enemies collide with a bullet or player, they are destroyed, and N small enemies spawn in its placen where N is the nulber of vertices o the original enemy. These small entities travel outward at angles at a fixed intervals equal to (360/vertices).
- Each time an enmy spawns, it is given a score component of N*100, where N is the nulber of vertices it has. Small ennemies get double this value.
- If a player bullet kills an enemy, the game score is increased by th score component of the enemy killed.
- The score should be displayed with the font specidied by the config file in the top-left corner of the screen.
- In the render system, all entities should be given a slow rotation, which makes the game look a little nicer.
- Any other effects that do not affect the gameplay can be added.
- Any Entity with a lifespan is currently alive, it should have its Color alpha channel set to a ratio depending on how long it has left to live.
-
Window: "W" idht, "H" eight, "F" rame_limit, "F" ull-screen.
-
Font: "F" ont, "S" ize, R, G, B.
-
Player: SR (Shape radius: int), CR (Collision Radius: int), Speed (float), FR-FG-FB (Fill color: int), OR-OG-OB (Outline color: int), OT (Outline Thickness: int), V (Shape Vertices: int)
-
Enemy: SR, CR, SMIN, SMAX (Min max speed float), OR-OG-OB,OT, VMIN,VMAX (min max vertices: int), L (small lifespan: int), SI (Spawn Intervalle)
-
Bullet SR, CR, S, FR-FG-FB, OR-OG-OB,OT, V,L
- Implement Vec2 class
- Implement basic fonctionality in the EntityManager class.
Implement the EntityManager's "addEntity()" and "update()" - SpawnPlayer(), Game::sRender(),spawnEnemy(),spawnBullet()
- Player movement
- Deletes dead entities
- getEntities(tag)
- Collision, destroy() for dead entities
From COMP 4300, Memorial University, CANADA teached by Associate Professor Dave Churchill.
Source: https://www.youtube.com/watch?v=OmzU_-zbE7o&t=3675s
Large improvments and additions could be made to this project but as a training project and not a genuine long term project, it is for me largely satisfactory in this current state ! :)