-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCrate.h
36 lines (29 loc) · 862 Bytes
/
Crate.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
#ifndef CRATE_H
#define CRATE_H
#include <iostream>
#include <SFML/Graphics.hpp>
#include "Platform.h"
class Crate
{
private:
sf::RectangleShape m_rect;
sf::Texture m_texture;
sf::Sprite m_sprite;
sf::Vector2f m_size;
float m_top, m_bottom, m_left, m_right;
sf::Vector2f m_movement;
float m_gravity;
bool m_onGround, m_onCrate, m_belowCrate, m_onLeft, m_onRight;
public:
void SetPosition(sf::Vector2f pos);
sf::Vector2f GetSize(), getMovement();
float getTop(), getBottom(), getLeft(), getRight();
bool getOnLeft(), getOnRight(), getOnCrate(), getBelowCrate();
void setOnCrate(), setBelowCrate(bool b);
void CrateCollide(float top, float bottom, float left, float right);
public:
Crate();
void Update(sf::RenderWindow &window, sf::Time &deltaTime, int map[50][50], std::vector<Platform> &p);
void Draw(sf::RenderWindow &window);
};
#endif