-
Notifications
You must be signed in to change notification settings - Fork 0
/
Block.h
44 lines (33 loc) · 774 Bytes
/
Block.h
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
/*
* Block.h
*
* Created on: 8 maj 2010
* Author: meros
*/
#ifndef BLOCK_H_
#define BLOCK_H_
#include "IDrawable.h"
#include "ContactListener.h"
#include "Sprite.h"
#include <Box2D/Box2D.h>
//A non interactive game block
class Block: public IDrawable, public UserData {
public:
Block(b2World& aWorld, float aX, float aY, float aW, float aH,
bool aDynamic = false);
virtual ~Block();
void Draw(sf::RenderTarget& aTarget, float aXScale, float aYScale,
float aXTranslate, float aYTranslate);
void SetCloud(bool aCloudFlag);
protected:
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
private:
float myX;
float myY;
float myW;
float myH;
b2Body* myCollisionBody;
Sprite mySprite;
bool myIsCloud;
};
#endif /* BLOCK_H_ */