add graphic assets
|
After Width: | Height: | Size: 212 B |
|
After Width: | Height: | Size: 473 B |
|
After Width: | Height: | Size: 614 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 441 B |
|
After Width: | Height: | Size: 137 B |
|
After Width: | Height: | Size: 495 B |
|
After Width: | Height: | Size: 81 B |
|
After Width: | Height: | Size: 113 B |
|
After Width: | Height: | Size: 573 B |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -3,8 +3,7 @@
|
|||||||
#include <SFML/System/Vector2.hpp>
|
#include <SFML/System/Vector2.hpp>
|
||||||
#include <SFML/Window/Keyboard.hpp>
|
#include <SFML/Window/Keyboard.hpp>
|
||||||
|
|
||||||
class TileMap : public sf::Drawable, public sf::Transformable
|
class TileMap : public sf::Drawable, public sf::Transformable {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
bool load(const std::filesystem::path& tileset, sf::Vector2u tileSize, const int* tiles, unsigned int width, unsigned int height)
|
bool load(const std::filesystem::path& tileset, sf::Vector2u tileSize, const int* tiles, unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -83,13 +82,13 @@ int main()
|
|||||||
};
|
};
|
||||||
|
|
||||||
TileMap map;
|
TileMap map;
|
||||||
if (!map.load("src/tileset.png", {32, 32}, level.data(), 16, 8))
|
if (!map.load("assets/tileset.png", {32, 32}, level.data(), 16, 8))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
auto window = sf::RenderWindow(sf::VideoMode({1920u, 1080u}), "Pacmen");
|
auto window = sf::RenderWindow(sf::VideoMode({1920u, 1080u}), "Pacmen");
|
||||||
window.setFramerateLimit(144);
|
window.setFramerateLimit(144);
|
||||||
|
|
||||||
sf::CircleShape pacman(25.0f);
|
sf::CircleShape pacman(16.0f);
|
||||||
pacman.setFillColor(sf::Color(255, 255, 0));
|
pacman.setFillColor(sf::Color(255, 255, 0));
|
||||||
|
|
||||||
while (window.isOpen())
|
while (window.isOpen())
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.1 KiB |