-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpecularObject.cpp
28 lines (23 loc) · 938 Bytes
/
SpecularObject.cpp
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
// game engine include
#include "GraphicsManager.h"
#include "SpecularObject.h"
// default constructor
SpecularObject::SpecularObject(){
setType("SpecularObject");
setSolidness(df::SPECTRAL);
}
// overloaded constructor for setting initial position
SpecularObject::SpecularObject(df::Position pos){
setType("SpecularObject");
setSolidness(df::SPECTRAL);
setPosition(pos);
}
// how to draw the car on the screen
void SpecularObject::draw(){
int x = getPosition().getX();
int y = getPosition().getY();
// multiline drawing of a car
df::GraphicsManager::getInstance().drawString(df::Position(x, y), "+--+", df::Justification::LEFT_JUSTIFIED, df::Color::YELLOW);
df::GraphicsManager::getInstance().drawString(df::Position(x, y+1), "| |", df::Justification::LEFT_JUSTIFIED, df::Color::YELLOW);
df::GraphicsManager::getInstance().drawString(df::Position(x, y+2), "+--+", df::Justification::LEFT_JUSTIFIED, df::Color::YELLOW);
}