-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDice.h
More file actions
41 lines (32 loc) · 747 Bytes
/
Dice.h
File metadata and controls
41 lines (32 loc) · 747 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
#pragma once
#define DICE_H
#include "Entity.h"
#include "DiceAnimation.h"
//#include "AnimationComponent.h"
class Dice
: public Entity
{
private:
int sides;
float totalTime;
float switchTime;
short unsigned diceState;
sf::RectangleShape* dice;
sf::Texture texture;
DiceAnimation* dice_animation;
public:
//Init components
void initVariables(float x, float y);
void initComponents();
void initTextures();
//constructor
Dice(float x, float y);
~Dice();
//Accessors
//const bool isPressed() const;
//functions to get values
int rollDice(const float& dt);
int randomGenerator();
void update(const float& dt, const sf::Vector2f mousePos);
void render(sf::RenderTarget* target);
};