-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawObject.cpp
More file actions
34 lines (26 loc) · 1.04 KB
/
DrawObject.cpp
File metadata and controls
34 lines (26 loc) · 1.04 KB
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
#include "DrawObject.h"
DrawObject::DrawObject(double x, double y, int depth):X(x),Y(y),ZDepth(depth),visible(true){
sprite = new BITMAP;
};
DrawObject::~DrawObject(){
delete sprite;
};
//***********************************************
// OTHER FUNCTIONS
//***********************************************
void DrawObject::drawShadow() const{
double correctedX = X - CAMERA->getX();
double correctedY = Y - CAMERA->getY();
//GRAPHIC
circlefill(CANVAS, (int)correctedX + size/3, (int)correctedY + size/3, (int)(size*0.9f), makecol(0,0,20));
};
//***********************************************
// GETTERS/SETTERS
//***********************************************
double DrawObject::getX() const {return X;};
double DrawObject::getY() const {return Y;};
int DrawObject::getZDepth() const {return ZDepth;};
int DrawObject::getSize() const {return size;};
void DrawObject::setX(double new_x){X = new_x;};
void DrawObject::setY(double new_y){Y = new_y;};
void DrawObject::setZDepth(int new_depth){ZDepth = new_depth;};