Snake ! 0.3-alpha


Snake is a little C++ / OpenGL project which shows a snake eating apples on a two dimensional board. It really is very much like the famous Nokia phone game except the snake finds its way on its own.

No nice textures, no sweet drawings yet. The world elements are mostly simple spheres. Trivial OpenGL features such as fog, lightning and shadows are implemented though.
Oh, and the snake it quite stupid at the moment. I wrote the path finding algorithm in an hour or so and I really need to come up with something smarter.
It is currently based on a simple A* shortest path finding algorithm which, despite being a somewhat working approach, is very limited.

It still is a game as the "user" can at any moment deactivate the auto-pilot and take the control of the snake himself. Whenever the user chooses to do so (by pushing "o"), the camera rotation stops and moves to the bottom of the board.

The project is open-source'd under GNU LGPL license and if you're interested in OpenGL, (soft-)realtime C++ programming or simple algorithms you might very well enjoy having a look at the source code provided here.

The source code :

snake-0.3-src.alpha.tar.gz

I managed to build a win32 executable using the GLUT library and mingw32:

snake-bin-win32-03.alpha.zip.

This project is provided as a standard *nix project and has a makefile (no configure script). To build it, just go in the root folder and type make.
The project needs the following libraries : libGL.so, libXmu.so, librt.so, libGLU.so, libglut.so.
There is also a QT version and a meamo (Nokia n900) version. The version to be built is chosen from the makefile.

There are good chance one needs to change the makefile to make it fit its Linux (or Mingw) distribution.

User manual :

s - start/stop the camera rotation
o - turns the auto-pilot engine on/off

When auto-pilot is turned off, one can use u, h, j, k to control the snake

Happy snaking !

 
 
 
 
Comments:

Post a Comment:
  • HTML Syntax: Allowed
 
« mai 2013
lun.mar.mer.jeu.ven.sam.dim.
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today
 
© Badtrash