You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.7 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Snake Game in C++
  2. ## Abstract
  3. A simple snake game, with terminal GUI implemented using ncurses library.
  4. #### Controls:
  5. - __Up-Arrow__ to go up.
  6. - __Down-Arrow__ to go down.
  7. - __Left-Arrow__ to go left.
  8. - __Right-Arrow__ to go right.
  9. - __q__ to exit game.
  10. ### TODO:
  11. - [x] Increase speed of the snake when it devours a snack.
  12. - [ ] Add a scoreboard.
  13. - [ ] Fix the window-resize factor, since it gets all messy when you minimize/maximize the terminal window.
  14. - [ ] Create a 'Game' class and provide interface through that function so that the user don't have to mess with the graphics
  15. snake and controller classes.
  16. ---
  17. ## Prerequisities
  18. You need to install the following two packages:
  19. - __libncurses5-dev__ : Developer’s libraries for ncurses,
  20. - __libncursesw5-dev__ : Developer’s libraries for ncursesw,
  21. - __gcc__ : C\C++ compiler,
  22. - __make__ : instalation tool.
  23. Open up a terminal and type the folllowing commands
  24. ```shell
  25. ~$ sudo apt update && sudo apt upgrade
  26. #Now to install compiler and instalation tool
  27. ~$ sudo apt-get install gcc make
  28. #And the actuall library
  29. ~$ sudo apt-get install libncurses5-dev libncursesw5-dev
  30. ```
  31. Now you are ready to use the repo.
  32. ---
  33. ## Downloading, Instalation and Running the Program
  34. Now we will install and run the program, but first let's download the repo:
  35. ```shell
  36. ~$ git clone https://github.com/VissaMoutafis/Snake_Game_in_Cpp
  37. # cd in the directory
  38. ~$ cd Snake_Game_in_Cpp
  39. #run the 'make run' to install and play
  40. ~$ make run
  41. ```
  42. and enjoy playing!
  43. __Note__: You might want to delete the objective files and keep only the src part. In that case:
  44. ```shell
  45. ~$ make clean
  46. ```
  47. and you are set.
  48. ---
  49. ## Contributors
  50. [VissaM](https://github.com/VissaMoutafis)
  51. ---
  52. ## Licence: MIT
  53. Check the file LICENCE.
  54. ### Enjoy!