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.
29 lines
678 B
C
29 lines
678 B
C
6 years ago
|
#pragma once
|
||
6 years ago
|
#include <allegro5/allegro.h>
|
||
6 years ago
|
|
||
|
#include "enums.h"
|
||
|
|
||
6 years ago
|
//Game Element base class, with position, height, and screen bounding properties along with its behavior
|
||
6 years ago
|
class GameElement {
|
||
|
public:
|
||
|
float x_pos;
|
||
|
float y_pos;
|
||
6 years ago
|
float h_t_bound;
|
||
|
float h_b_bound;
|
||
6 years ago
|
float l_bound;
|
||
|
float r_bound;
|
||
6 years ago
|
float speed;
|
||
6 years ago
|
float height;
|
||
|
float width;
|
||
6 years ago
|
bool oob;
|
||
6 years ago
|
Behavior behavior;
|
||
6 years ago
|
|
||
|
//Set position of object
|
||
6 years ago
|
virtual void reset_pos(float x, float y) = 0;
|
||
6 years ago
|
//Move object
|
||
6 years ago
|
virtual void move(Direction dir) = 0;
|
||
6 years ago
|
//Draw object to screen
|
||
6 years ago
|
virtual void draw() = 0;
|
||
6 years ago
|
//Build hitbox struct for the object at position in current frame
|
||
6 years ago
|
virtual Hitbox get_hitbox() = 0;
|
||
6 years ago
|
};
|