In this snake game Pacman is the antagonist. The goal is to eat the food that appears randomly and not get caught by Pacman.
- cmake >= 3.7
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- SDL2 >= 2.0
- All installation instructions can be found here
Note that for Linux, an
apt
orapt-get
installation is preferred to building from source. - SDL2_image >= 2.0
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- Clone this repo.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./SnakeGame
.
project
| .gitignore
| CMakeLists.txt
| LICENSE.md
| README.md
│
└─── assets
│ | pacman_and_ghost_texture.png
│ | snake_v_pacman.gif
│
└─── cmake
| | FindSDL2_image.cmake
│
└─── src
| actor.h
| controller.cpp
| controller.h
| game.cpp
| game.h
| main.cpp
| pacman.cpp
| pacman.h
| renderer.cpp
| snake.cpp
| snake.h
- Instructions
- 3rd party libraries: SDL2, SDL2_image
- Description
- Compile & run without error
- Functions and control structures
- Reads files, process data, outputs it
- Accepts user input & output
- Organized in classes
- Appropriate access for class members
- Initialization lists
- Clear interfaces
- Encapsulate behaviour
- Inheritance
- Overloaded functions
- Override virtual functions
- Templates
- Pass-by-reference
- Appropriate use of destructors
- Uses RAII
- Follows the Rule of 5
- Uses move semantics instead of copying
- Smart pointers instead of raw pointers
- Uses multiple threads
- Uses promise & future
- Uses mutex or lock
- Uses condition variable