No description
  • C 94.8%
  • CMake 3.7%
  • C++ 1.5%
Find a file
2024-05-05 19:51:22 +02:00
assets Adjust volume of crash and portal sounds 2024-01-07 21:47:26 +01:00
include Change key event 'q' 2024-05-05 19:35:47 +02:00
src Change key event 'q' 2024-05-05 19:35:47 +02:00
.gitignore gitignore: ignore *.bin files (player_scores.bin) 2023-12-22 13:43:24 +01:00
CMakeLists.txt Add CPack for creating releases for windows (zip) 2023-12-19 09:44:54 -08:00
demo.jpg Update Readme: Add image, Optimize links 2023-12-17 22:54:32 +01:00
function-flowcharts.drawio.pdf Update flowchart, Add global SDL variables 2023-12-12 09:52:08 +01:00
module-overview.drawio.pdf Update module structure: Add map.c 2023-11-10 12:46:00 +01:00
README.md Update Readme: Add install section 2024-01-07 22:17:32 +01:00

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?