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