diff --git a/.gitignore b/.gitignore index 7a93400..c90802d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,8 @@ *.app *.json *.ps1 + +# Extras +.vs* +build +bin \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..254adca --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +INC := -I include +STD := -std=c++11 +SFML := -lsfml-graphics -lsfml-window -lsfml-system + +all: compile link + +compile: + g++ $(INC) $(STD) -c -o build/main.o src/main.cpp + g++ $(INC) $(STD) -c -o build/GameState.o src/GameState.cpp + g++ $(INC) $(STD) -c -o build/Snake.o src/Snake.cpp + g++ $(INC) $(STD) -c -o build/SnakeFood.o src/SnakeFood.cpp + +link: + g++ build/*.o -o bin/SnakePlusPlus.out $(SFML) \ No newline at end of file diff --git a/src/GameState.h b/include/GameState.h similarity index 100% rename from src/GameState.h rename to include/GameState.h diff --git a/src/Snake.h b/include/Snake.h similarity index 91% rename from src/Snake.h rename to include/Snake.h index b7f7a70..aa873b3 100644 --- a/src/Snake.h +++ b/include/Snake.h @@ -2,6 +2,10 @@ #ifndef SNAKE_H #define SNAKE_H +#include +#include +#include "SnakeFood.h" + sf::Vector2f CalculateNewPosition(int direction, sf::Vector2f position); bool GlobalCollision(sf::Vector2f object1Position, sf::Vector2f object2Position); diff --git a/src/SnakeFood.h b/include/SnakeFood.h similarity index 100% rename from src/SnakeFood.h rename to include/SnakeFood.h