diff --git a/Game.cpp b/Game.cpp index 717d51e..3a1e1f6 100644 --- a/Game.cpp +++ b/Game.cpp @@ -80,7 +80,7 @@ Game::Game(Config &c) : player(MAX_SPEED, SPEED_MUL, ACC_INC, 1.25f, 0.9375f, MA Texture t; // Load the textures of the panel and assign them to their sprites - for (int i = 1; i <= 6; i++) { + for (int i = 1; i <= 22; i++) { // Load the texture from the file t.loadFromFile("resources/GamePanel/" + to_string(i) + ".png"); textures.push_back(t); diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..986ddd1 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ + +CXXFLAGS = -g -std=c++14 + +LIBS = -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system + +DEPS = Button.hpp Enemy.hpp Game.hpp KeywordMapper.hpp Map.hpp Menu.hpp Player.hpp Random.hpp Score.hpp Vehicle.hpp +OBJS = Button.o Enemy.o Game.o KeywordMapper.o Map.o Menu.o Player.o Random.o Score.o Vehicle.o main.o +TARGET = outrun + +%.o: %.cpp $(DEPS) + $(CXX) -c $(CXXFLAGS) $< + +$(TARGET): $(OBJS) + $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) + +clean: + rm -f $(OBJS) $(TARGET) diff --git a/Map.cpp b/Map.cpp index d3e6b45..62f8b60 100644 --- a/Map.cpp +++ b/Map.cpp @@ -940,7 +940,7 @@ void Map::draw(Config &c, vector &vehicles) { c.w.getSize().x, c.w.getSize().y, ROADW, n < N ? 0.0f : lines[lines.size() - 1].z); // Draw road - if (visibleLines.back() == n) { + if (visibleLines.size() > 0 && visibleLines.back() == n) { visibleLines.pop_back(); Color grassRight, grass, roadRight, road, rumbleRight, rumble, dashRight, dash; diff --git a/Menu.hpp b/Menu.hpp index 93ba3a4..618ec52 100644 --- a/Menu.hpp +++ b/Menu.hpp @@ -11,6 +11,7 @@ #include #include +#include #include "Button.hpp" #include "KeywordMapper.hpp" #include "Score.hpp"