mirror of
https://github.com/dylanbenzi/pacmen-sfml.git
synced 2026-11-27 08:26:59 +00:00
modify entity class items
This commit is contained in:
+9
-3
@@ -1,8 +1,10 @@
|
||||
#ifndef ENTITY_H
|
||||
#define ENTITY_H
|
||||
|
||||
#include "TileMap.h"
|
||||
#include <SFML/Graphics/Drawable.hpp>
|
||||
#include <SFML/Graphics/PrimitiveType.hpp>
|
||||
#include <SFML/Graphics/Rect.hpp>
|
||||
#include <SFML/Graphics/RenderStates.hpp>
|
||||
#include <SFML/Graphics/RenderTarget.hpp>
|
||||
#include <SFML/Graphics/Texture.hpp>
|
||||
@@ -21,14 +23,18 @@ enum class MovementDir {
|
||||
|
||||
class Entity : public sf::Drawable, public sf::Transformable {
|
||||
public:
|
||||
Entity();
|
||||
Entity(TileMap& map) : map(map) {};
|
||||
|
||||
//assumes entity texture is one row of various animation texture states
|
||||
bool loadTexture(const std::filesystem::path& texturePath, sf::Vector2u tileSize, int tiles);
|
||||
bool loadTexture(const std::filesystem::path& texturePath, sf::Vector2u graphicTileSize, int tiles);
|
||||
|
||||
void setTextureFrame(const sf::IntRect& rectangle);
|
||||
protected:
|
||||
TileMap map;
|
||||
|
||||
sf::VertexArray vertexArray;
|
||||
sf::Texture texture;
|
||||
|
||||
int animationTiles;
|
||||
int movementSpeed = 5;
|
||||
|
||||
void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
|
||||
|
||||
Reference in New Issue
Block a user