https://github.com/aryaminus/srijana
A C++ and Opengl based game to draw a window leading to snake which runs on neural network to reach it's food within certain iteration for AI along with Keyboard press to move the Snake quads. Youtube:
https://github.com/aryaminus/srijana
ai artificial-intelligence artificial-intelligence-algorithms artificial-neural-networks cpp freeglut game graphics keyboard linux neural-network opengl perspective q-learning
Last synced: about 1 year ago
JSON representation
A C++ and Opengl based game to draw a window leading to snake which runs on neural network to reach it's food within certain iteration for AI along with Keyboard press to move the Snake quads. Youtube:
- Host: GitHub
- URL: https://github.com/aryaminus/srijana
- Owner: aryaminus
- License: mit
- Created: 2018-01-21T12:23:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-11T18:00:15.000Z (over 8 years ago)
- Last Synced: 2025-04-23T06:14:16.094Z (about 1 year ago)
- Topics: ai, artificial-intelligence, artificial-intelligence-algorithms, artificial-neural-networks, cpp, freeglut, game, graphics, keyboard, linux, neural-network, opengl, perspective, q-learning
- Language: C++
- Homepage: https://youtu.be/Cpj3XVdsK_g
- Size: 716 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Srijana - OpenGL based 2D Snake game
A C++ and OpenGL based game made for 5th semester Graphics Project and Neural Network used to display snake quad to move towards food in random state with both keyboard press and neural processing to locate food using artificial intelligence AI for automatic playing and score monitoring.
**Currently in beta state**
[](https://youtu.be/Cpj3XVdsK_g)
**Note:**
Make sure you have opengl, freeglut3-dev & libgl1-mesa-dev
## Installation
Clone the source locally:
```
$ git clone https://github.com/aryaminus/srijana
$ cd srijana
$ make run
```
***else***
```
$ git clone https://github.com/aryaminus/srijana
$ cd srijana
$ g++ main.cpp -lGL -lglut -lGLU -o main
$ ./main
```
***For Codeblocks:***
- Open local source file main.cpp from Srijana directory
- **Before Build & Run**, goto:
```
-> Settings / Compiler / Global Compiler Settings / Linker Settings
```
- in Other linker options:
```
-lGL -lglut -lGLU
```
[](https://i.imgur.com/ZA5RDfW.png)
## Todo
- [x] Fix gluPerspective from glOrtho when moving from welcome() to DrawNeural()
- [x] When clicked User/Play_Neural, resize is needed which needs to be fixed
- [ ] Implementation of better algorithm than Q-learning
- [x] Header to show score in window for DrawUser
- [x] Setup for Keyboard press to navigate snake
## Reference
1. snake
2. snake-unix
3. airplane-game
4. q_snake
-----------------------------------------------------------------------------------------------------------
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request
**Enjoy!**