-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMovingPlatform.cpp
45 lines (37 loc) · 1.15 KB
/
MovingPlatform.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "MovingPlatform.h"
#include "MovingObject.h"
#include "Player.h"
#include <fstream>
MovingPlatform::MovingPlatform(float x, float y, int width, int height, char *textureSource, POS startPos, POS endPos, movingType moveType, float speed)
:MovingObject(MOVING_PLATFORM, x, y, width, height, textureSource, startPos, endPos, moveType, speed)
{
// ctor
setResizeable(true);
}
MovingPlatform::~MovingPlatform()
{
// dtor
}
void MovingPlatform::update(float dt)
{
MovingObject::update(dt);
}
void MovingPlatform::draw(void)
{
// Behöver inte mer avancerad draw
MovingObject::draw();
}
void MovingPlatform::saveToFile(std::ofstream *fout)
{
*fout << getType() << " " << getID() << " " << (int)getX() << " " << (int)getY() << " " << (int)getStartPos().x << " " << (int)getStartPos().y << " " << (int)getEndPos().x << " " << (int)getEndPos().y << " ";
*fout << getWidth() << " " << getHeight() << " " << getSpeed() << " ";
*fout << getTextureSource() << endl;
}
void MovingPlatform::move(float dx, float dy)
{
MovingObject::move(dx, dy);
}
void MovingPlatform::scale(direction side, int dwidth, int dheight)
{
MovingObject::scale(side, dwidth, dheight);
}