You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1006 B
C

#pragma once
#include <vector>
#include "enums.h"
#include "bullet.h"
#include "ship.h"
#include "star.h"
6 years ago
//Manages all onscreen object movements, drawing, and hitbox detection
class ObjectManager {
public:
Ship player;
std::vector<Ship> enemies;
std::vector<Bullet> player_bullets;
6 years ago
std::vector<Bullet> enemy_bullets; //saved for future use
std::vector<Star> background;
ObjectManager();
void init_player(Ship _player);
6 years ago
//Collision detection methods
bool chk_player_col();
int chk_bullet_col();
6 years ago
//Draw objects to screen
void draw_objects();
6 years ago
//Originally for garbage collection, once moved away fromp pointers it became kind of useless
void destroy_objects();
6 years ago
//Moves all enemies on screen and checks bounds
void move_enemies();
6 years ago
//Set and move the background, originally supposed to be tilemaps now Star objects
void set_background();
void move_background();
private:
6 years ago
//Check if two hitboxes are colliding
bool col_eval(Hitbox h1, Hitbox h2);
};