Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ void Map::draw(Config &c, vector<Enemy> &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;
Expand Down
1 change: 1 addition & 0 deletions Menu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <vector>
#include <iostream>
#include <memory>
#include "Button.hpp"
#include "KeywordMapper.hpp"
#include "Score.hpp"
Expand Down