top of page
Game Engine Code Samples
Vectors
My own Vector.h and .cpp class that the player and enemies use. This is mainly to control movement and normalize it as well as firing bullets:


Implementation of players shoot origin and aim direction (inside of game.cpp):

Bullets
The bullet.h and .cpp which adds the bullet with collisions to them which are destroyed when going oput of bounds from the game window.



Bullet implementation in game.cpp (shoot cooldown, adding bullets when fired and delete bullets when colliding with window bounds):


bottom of page