Snake++

Development of the game "Snake" featuring portals, custom maps and sound effects.
Cross-platform compatibility using CMake, C, C++ and SDL2.
A project for the Software Engineering course as part of our studies.

Preview

Installation

For Windows 64-Bit a pre-compiled release, that also includes the required .dll files and assets is available:

  • Download the zip file from Releases (e.g. "Snake-1.0-win64.zip")
  • Extract zip file
  • Navigate to the folder and run Snake.exe On other Systems you currently have to compile from source (see next sections)

Compilation

Linux

Install tools and SDL2

pacman -S sdl2 sdl2_ttf
pacman -S cmake gcc

Build

mkdir build
cd build
cmake ..
make

Windows

Download SDL

  • Download SDL2-devel-2.28.5-VC.zip from github/libsdl-org
  • Unzip the file and rename the folder to SDL2 (avoid unnecessary subfolder)
  • Place it in the root folder of this repository.

Download SDL_ttf

  • Download SDL2_ttf-devel-2.20.2-VC.zip from github/libsdl-org
  • Unzip the file and rename the folder to SDL2_ttf (avoid unnecessary subfolder)
  • Place it in the root folder of this repository.

Install compiler (if not available already)

  • download mingw:
  • Extract the contents to C:\MinGW
  • Add the path of MinGW/bin folder to system environment variable PATH (so CMake finds it as 'Kit'):
    • Open 'Control Panel' -> 'Edit the system environment variables' -> 'PATH' -> Add entry C:\MinGW\bin

Install CMake

Compile
See VS Code section

VS Code instructions

Required extensions

Setup

  • With CmakeTools installed open the project folder in VS Code
  • open cmd-prompt with CTRL + SHIFT + P run cmake.build
    • select kit (gcc or installed minGW compiler)
      Alternatively use cmake related buttons in bottom toolbar (CMake: Kit, Build, [all]...)

Compile

  • Use buttons in bottom toolbar (CMake: ... Build [BUG-BUTTON] [PLAY-BUTTON] ... )
    You can also use:
  • ctrl-F5 run without debugger
  • shift-F5 run with debugger
  • NOTE: Pressing F5 only, currently does not work with CMake in VS-Code?
Description
No description provided
Readme 2.5 MiB
Languages
C 94.8%
CMake 3.7%
C++ 1.5%