From bf34d835e4ea49bd4ef2e5de2b1fea2fd3c95adc Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Tue, 29 Nov 2022 18:19:25 +0100 Subject: Start to use a normal game structure: - App class that has a StateStack - StateStack - Some State definiton and a minimal TitleState to use as a template - Makefile updated accordingly - Delete old code that was there for testing --- src/states/titleState.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/states/titleState.cpp (limited to 'src/states/titleState.cpp') diff --git a/src/states/titleState.cpp b/src/states/titleState.cpp new file mode 100644 index 0000000..a0d17c8 --- /dev/null +++ b/src/states/titleState.cpp @@ -0,0 +1,25 @@ +#include "titleState.h" +#include + +TitleState::TitleState(StateStack &stack, State::Context context) + : State(stack, context) +{ + +} + +void TitleState::update(sf::Time dt){ + +} + +void TitleState::render(){ + sf::RectangleShape rectangle; + rectangle.setSize(sf::Vector2f(100, 50)); + rectangle.setOutlineColor(sf::Color::Red); + rectangle.setOutlineThickness(5); + rectangle.setPosition(10, 20); + context_.window->draw(rectangle); +} + +void TitleState::handleEvent(const sf::Event &event){ + +} -- cgit v1.2.3