2024-05-27 16:44:01 -03:00
|
|
|
#ifndef PLATFORMSTARTERKIT_TILE_HPP
|
|
|
|
#define PLATFORMSTARTERKIT_TILE_HPP
|
|
|
|
|
2024-07-13 22:50:52 -03:00
|
|
|
#include "headers.hpp"
|
|
|
|
|
2024-05-27 16:44:01 -03:00
|
|
|
namespace PlatformerStarterKit {
|
|
|
|
// Controls the collision detection and response behavior of a tile.
|
|
|
|
enum class TileCollision {
|
|
|
|
Passable = 0,
|
|
|
|
Impassable = 1,
|
|
|
|
Platform = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Tile {
|
|
|
|
xna::PTexture2D Texture = nullptr;
|
|
|
|
TileCollision Collision{};
|
2024-05-30 22:14:01 -03:00
|
|
|
constexpr static int Width = 40;
|
|
|
|
constexpr static int Height = 32;
|
2024-05-27 16:44:01 -03:00
|
|
|
|
|
|
|
constexpr static xna::Vector2 Size() {
|
|
|
|
return{ Width, Height };
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr Tile() = default;
|
|
|
|
Tile(xna::PTexture2D const& texture, TileCollision collision) :
|
|
|
|
Texture(texture), Collision(collision) {}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|