-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObject.h
More file actions
43 lines (35 loc) · 821 Bytes
/
Object.h
File metadata and controls
43 lines (35 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "GL/freeglut.h"
#include "Hitbox.h"
#include "Texture.h"
#include <iostream>
#include <vector>
using namespace std;
enum KEY { LEFT, RIGHT, UP, DOWN, SPACEBAR, RESTART };
enum STATE { STAY, JUMP, FALL };
class Object
{
public:
// constructor
Object();
// position methods
void setPosition(float x, float y);
float* getPosition();
void setPositionX(float x);
float getPositionX();
void setPositionY(float y);
float getPositionY();
// velocity methods
void setVelocity(float v1, float v2);
float* getVelocity();
void setVelocityX(float v1);
float getVelocityX();
void setVelocityY(float v2);
float getVelocityY();
virtual Hitbox getHitbox();
void translate(float x, float y);
bool collisionDetection(Object& other);
protected:
float position[2];
float velocity[2];
};