Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.24 KB

README.md

File metadata and controls

25 lines (20 loc) · 1.24 KB

MultithreadedSnake

This repository consists of the code that was used to create a multi-threaded snake game. In the snake game, a player controls the snake's head, and must move it using the up, down, left and right arrow keys. If the snake's head collides with any part of the snake's body, or the borders of the game board, the game is over. The snake grows by eating an apple that randomly spawns in some position of the board.

Gameplay (x4 speedup)

snake-gameplay-trim_VaPDI1h1.mp4

Language & Libraries

  • Made with C/C++
  • Includes the Allegro 4.4.2 library (a game library for C/C++ programming and includes DirectX and OpenGL to support it)
  • Includes the Pthreads library for Windows

Multithreaded Aspects

  • Spawning the apple in a random location
  • Handling keyboard input
  • Ending the game abruptly when the ESC key is pressed
  • The main thread (includes the game loop in the play_game() method)

Attribution