<?xml version="1.0" encoding='utf-8'?>
<?xml-stylesheet type="text/xsl" href="https://www.niceideas.ch/roller2/roller-ui/styles/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom">
    <title type="html">niceideas.ch</title>
    <subtitle type="html">Technological Thoughts by Jerome Kehrli</subtitle>
    <id>https://www.niceideas.ch/roller2/badtrash/feed/entries/atom</id>
            <link rel="self" type="application/atom+xml" href="https://www.niceideas.ch/roller2/badtrash/feed/entries/atom?cat=OpenGL" />
        <link rel="alternate" type="text/html" href="https://www.niceideas.ch/roller2/badtrash/" />
        <updated>2026-04-09T06:13:17-04:00</updated>
    <generator uri="http://roller.apache.org" version="5.1.2">Apache Roller</generator>
        <entry>
        <id>https://www.niceideas.ch/roller2/badtrash/entry/snake-reloaded</id>
        <title type="html">Snake ! Reloaded ...</title>
        <author><name>Jerome Kehrli</name></author>
        <link rel="alternate" type="text/html" href="https://www.niceideas.ch/roller2/badtrash/entry/snake-reloaded"/>
        <published>2016-10-22T08:06:40-04:00</published>
        <updated>2017-09-13T16:45:33-04:00</updated> 
        <category term="OpenGL" label="OpenGL" />
        <category term="algorithms" scheme="http://roller.apache.org/ns/tags/" />
        <category term="c++" scheme="http://roller.apache.org/ns/tags/" />
        <category term="opengl" scheme="http://roller.apache.org/ns/tags/" />
        <category term="real-time" scheme="http://roller.apache.org/ns/tags/" />
        <category term="snake" scheme="http://roller.apache.org/ns/tags/" />
        <summary type="html">&lt;p&gt;
I needed to have a little fun recently when slacking on my computer at night so, as is often the case in such situation, 
I spent some time on my &lt;i&gt;snake&lt;/i&gt; project again. 
&lt;br&gt; 
I implemented a few evolutions as explained below and am now working on making the &lt;i&gt;auto-pilot&lt;/i&gt; algorithm a little 
better.
&lt;br&gt;
It&apos;s funny how this snake application is something on which I get over and over again years after years, trying to make it 
better, reworking it, etc. 
&lt;/p&gt;
&lt;p&gt;
The first post on this blog about this app was there : 
&lt;a href=&quot;https://www.niceideas.ch/roller2/badtrash/entry/snake-tt-0-2-alpha&quot;&gt;www.niceideas.ch/roller2/badtrash/entry/snake-tt-0-2-alpha&lt;/a&gt;
&lt;br&gt;
Yeah, well, that doesn&apos;t make me younger, does it ?
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;The snake project&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
Snake is a little C++ / OpenGL / Real-Time 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.
&lt;/p&gt;
&lt;p&gt;
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. 
&lt;/p&gt;
&lt;p&gt;
The &lt;i&gt;auto-pilot&lt;/i&gt; is still pretty stupid at the moment and the snake ends up eating itself quite fast. 
&lt;br&gt;
This is the thing on which I am working now.
&lt;/p&gt;

&lt;div class=&quot;centering&quot;&gt;
&lt;img class=&quot;centered&quot; alt=&quot;Snake Application Screenshot&quot; src=&quot;https://niceideas.ch/roller2/badtrash/mediaresource/9b09370b-6ff9-49da-a412-5f213dd3fd7f&quot; /&gt;
&lt;br&gt;
&lt;/div&gt;

&lt;p&gt;
It still is a game as the &quot;&lt;i&gt;user&lt;/i&gt;&quot; can at any moment deactivate the auto-pilot and take the control of the snake himself. 
At any moment, the auto-pilot can be re-engaged again or deactivated.
&lt;/p&gt;
&lt;p&gt;
The project is open-source&apos;d under GNU LGPL license and if you&apos;re interested in &lt;b&gt;OpenGL&lt;/b&gt;, &lt;b&gt;Vector Geometry&lt;/b&gt;, &lt;b&gt;Real-time 
C++ Programming&lt;/b&gt;, or simply &lt;b&gt;Algorithms&lt;/b&gt; you might very well enjoy having a look at the source code provided here.
&lt;/p&gt;</summary>
        <content type="html">&lt;!-- Snake ! Reloaded ... --&gt;

&lt;p&gt;
I needed to have a little fun recently when slacking on my computer at night so, as is often the case in such situation, 
I spent some time on my &lt;i&gt;snake&lt;/i&gt; project again. 
&lt;br&gt; 
I implemented a few evolutions as explained below and am now working on making the &lt;i&gt;auto-pilot&lt;/i&gt; algorithm a little 
better.
&lt;br&gt;
It&apos;s funny how this snake application is something on which I get over and over again years after years, trying to make it 
better, reworking it, etc. 
&lt;/p&gt;
&lt;p&gt;
The first post on this blog about this app was there : 
&lt;a href=&quot;https://www.niceideas.ch/roller2/badtrash/entry/snake-tt-0-2-alpha&quot;&gt;www.niceideas.ch/roller2/badtrash/entry/snake-tt-0-2-alpha&lt;/a&gt;
&lt;br&gt;
Yeah, well, that doesn&apos;t make me younger, does it ?
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;The snake project&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
Snake is a little C++ / OpenGL / Real-Time 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.
&lt;/p&gt;
&lt;p&gt;
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. 
&lt;/p&gt;
&lt;p&gt;
The &lt;i&gt;auto-pilot&lt;/i&gt; is still pretty stupid at the moment and the snake ends up eating itself quite fast. 
&lt;br&gt;
This is the thing on which I am working now.
&lt;/p&gt;

&lt;div class=&quot;centering&quot;&gt;
&lt;img class=&quot;centered&quot; alt=&quot;Snake Application Screenshot&quot; src=&quot;https://niceideas.ch/roller2/badtrash/mediaresource/9b09370b-6ff9-49da-a412-5f213dd3fd7f&quot; /&gt;
&lt;br&gt;
&lt;/div&gt;

&lt;p&gt;
It still is a game as the &quot;&lt;i&gt;user&lt;/i&gt;&quot; can at any moment deactivate the auto-pilot and take the control of the snake himself. 
At any moment, the auto-pilot can be re-engaged again or deactivated.
&lt;/p&gt;
&lt;p&gt;
The project is open-source&apos;d under GNU LGPL license and if you&apos;re interested in &lt;b&gt;OpenGL&lt;/b&gt;, &lt;b&gt;Vector Geometry&lt;/b&gt;, &lt;b&gt;Real-time 
C++ Programming&lt;/b&gt;, or simply &lt;b&gt;Algorithms&lt;/b&gt; you might very well enjoy having a look at the source code provided here.
&lt;/p&gt;


&lt;h2&gt;1. Windows Executables&lt;/h2&gt;

&lt;p&gt;
I have pre-compiled a windows executable using MingW and QT for Windows
&lt;/p&gt;
&lt;p&gt;
The pre-built Windows Binary Executable is available here :
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;https://www.niceideas.ch/roller2/badtrash/mediaresource/fb489174-1c48-4a07-aa22-f7e48d4854ca&quot; download=&quot;snake_win32_bin-0.3.1.zip&quot;&gt;snake_win32_bin-0.3.1.zip&lt;/a&gt;
&lt;/p&gt;

&lt;h2&gt;2. Build for Other platforms&lt;/h2&gt;

&lt;p&gt;
Snake can be built using two different OpenGL canvas providers in three different configurations: 
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the GLUT&lt;/li&gt;
&lt;li&gt;QT on Linux&lt;/li&gt;
&lt;li&gt;QT on Windows / MingW&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
MinGW, a contraction of &quot;&lt;i&gt;Minimalist GNU for Windows&lt;/i&gt;&quot;, is a minimalist development environment for native Microsoft Windows applications.
&lt;br&gt;
It&apos;s a pretty nifty compiler, Toolchain and tools collection for people such as myself who are very at ease with Unix but knows nothing about 
Windows (and I cannot stress enough how much this is a great source of pride and everyday happiness).
&lt;/p&gt;
&lt;p&gt;
The source code is available here: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;https://www.niceideas.ch/roller2/badtrash/mediaresource/862ef14e-6ef9-464c-ae88-171927abd9d8&quot; download=&quot;snake_src-0.3.1.zip&quot;&gt;snake_src-0.3.1.zip&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
In order to build the software, one needs to :
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Edit the file &lt;code&gt;Makefile&lt;/code&gt; and defined the variables identifying the Qt installation (in case of using Qt)&lt;/li&gt;
&lt;li&gt;Have GCC and the usual toolchain available in the &lt;code&gt;PATH&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Have OpenGL libraries (mesa or else) available in &lt;code&gt;LD_LIBRARY_PATH&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Open a console in the root folder of the source distribution&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;make&lt;/code&gt; and follow instructions&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;make clean&lt;/code&gt; to clean the binary objects&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;3. User Manual&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;s&lt;/b&gt; - start/stop the camera rotation&lt;/li&gt;
&lt;li&gt;&lt;b&gt;p&lt;/b&gt; - pause the game (both snake and camera rotation if enabled)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;o&lt;/b&gt; - turns the auto-pilot engine on/off&lt;/li&gt;
&lt;li&gt;&lt;b&gt;u, h, j, k&lt;/b&gt; - When auto-pilot is turned off, one can use they keys  to control the snake&lt;/li&gt;
&lt;li&gt;In addition, on the Qt version, the user can use the LEFT, RIGHT, UP, DOWN arrows to control the snake&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;4. Latest Changes&lt;/h2&gt;

&lt;p&gt;
&lt;b&gt;OpenGL Canvas library&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
I made a Qt version of the software since compiling the GLUT (or finding a binary version of it) under windows is a nightmare. The source code is very old and hasn&apos;t been maintained, etc.
&lt;br&gt;
Long story short, the &lt;a href=&quot;https://en.wikipedia.org/wiki/OpenGL_Utility_Toolkit&quot;&gt;GLUT library&lt;/a&gt;  is pretty much impossible to compile under windows MingW (well
OK at least let&apos;s say I didn&apos;t succeed in a few dozens of minutes so I dropped the idea) and I didn&apos;t want to bother on alternatives.
&lt;br&gt;
For the sake of completeness, let&apos;s say that the freeglut library is available for MingW and that would have been worth a try.
&lt;/p&gt;
&lt;p&gt;
Anyway, I wanted to use Qt since ... well I love Qt. I really regret the licensing approach and the fact its not a truly open source library 
(opensource license of Qt is very very restrictive) but the slots and signal concepts as well as the completness and the overall design of 
the library are definitely awesome. 
&lt;br&gt;
I&apos;ve been playing a lot with wxWidgets on Linux before I encountered Qt and I have to admit that I&apos;m really using exclusively Qt now when I program 
in C++. I&apos;ll share in a future post all the details in regards to why I believe Qt is awesome since this exceeds the scope of this article.
&lt;/p&gt;
&lt;p&gt;
So yeah I figured I just port the Snake app from GLUT to Qt instead of messing with alternatives to GLUT such as 
&lt;a href=&quot;http://freeglut.sourceforge.net/index.php#download&quot;&gt;freeglut&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Having done this, I can now easily build the snake project under both Windows/MingW and Linux.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Algorithm&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
I&apos;m trying to experience many things in regards to how make the snake &quot;&lt;i&gt;smarter&lt;/i&gt;&quot; and have him survive longer on the board.
&lt;/p&gt;
&lt;p&gt;
The key idea on which I am working now is to give a huge weight (see algorithm section below) to cells that would cause a 
partitioning of the board should the snake go on them.
&lt;/p&gt;
&lt;p&gt;
Implementing this should be straightforward, at least as much as the idea is simple, but happens to be difficult and I&apos;m struggling with it.
&lt;br&gt;
For the moment I de-activated this and left the current implementation as commented code in the software. If anyone is willing to help, I 
would be really happy to have a second pair of eyes on this.
&lt;/p&gt;

&lt;h2&gt;5. The algorithm&lt;/h2&gt;

&lt;p&gt;
The way the auto-pilot drives the snake is really a simple idea: representing the board as a graph and using dijsktra&apos;s shorted 
path algorithm to find the shortest path from the snake head to the seed
&lt;/p&gt;
&lt;p&gt;
The procedure &lt;code&gt;getNextDirection&lt;/code&gt; is called  each and every time the snake gets on a new cell to compute the 
direction he should take from there and hence the next cell he should reach.
&lt;/p&gt;

&lt;pre&gt;
&lt;b&gt;procedure&lt;/b&gt; getNextDirection

    headCell = get cell of position of head of the snake
    seedCell = get cell of position of the seed
    
    &lt;b&gt;for&lt;/b&gt; every &lt;i&gt;cell&lt;/i&gt; in board &lt;b&gt;do&lt;/b&gt;
        &lt;i&gt;computeCost&lt;/i&gt; of cell
    &lt;b&gt;end for&lt;/b&gt; 
    
    &lt;span style=&quot;color: green;&quot;&gt;-- build a graph-like structure of the board,  &lt;/span&gt;
    &lt;span style=&quot;color: green;&quot;&gt;-- connecting every cell with cost computed above &lt;/span&gt;
        
    adjacencyMap = initialize empty array of list
    
    &lt;b&gt;for&lt;/b&gt; every &lt;i&gt;cell&lt;/i&gt; in board &lt;b&gt;do&lt;/b&gt;
    
        &lt;b&gt;for&lt;/b&gt; every &lt;i&gt;neighbour&lt;/i&gt; of &lt;i&gt;cell&lt;/i&gt; &lt;b&gt;do&lt;/b&gt;  
            add to adjacencyMap[cell] 
                    an &lt;i&gt;edge&lt;/i&gt; to neighbour 
                    with as weight the cost of neighbour computed above
        &lt;b&gt;end for&lt;/b&gt; 
        
    &lt;b&gt;end for&lt;/b&gt; 
    
    &lt;span style=&quot;color: green;&quot;&gt;-- compute shortest path from every cell to every cell&lt;/span&gt;
    &lt;span style=&quot;color: green;&quot;&gt;-- using dijkstra&apos;s algorithm and the data structure above&lt;/span&gt;
    
    dijkstraMinDistance, dijsktraPreviousCell = run &lt;i&gt;dijkstra Shortest Path&lt;/i&gt; algorithm 
            on adjacencyMap for headCell
    
    &lt;span style=&quot;color: green;&quot;&gt;-- get distance in shortest path from headCell to seedCell &lt;/span&gt;
    minDistance = dijkstraMinDistance[seedCell] 
    
    cellTravelList = NULL;
    &lt;b&gt;if&lt;/b&gt; no path has been found &lt;b&gt;then&lt;/b&gt;
    
        &lt;span style=&quot;color: green;&quot;&gt;-- we have a partitioning (unconnected graph) of the board &lt;/span&gt;
        &lt;b&gt;return&lt;/b&gt; dummy random direction
        
    &lt;b&gt;else&lt;/b&gt;
    
        &lt;span style=&quot;color: green;&quot;&gt;-- build the path form headCell to seedCell&lt;/span&gt;
        cellTravelList = path to follow using dijsktra&apos;s computed &lt;i&gt;dijsktraPreviousCell&lt;/i&gt;i&gt; above
        
        &lt;b&gt;return&lt;/b&gt; next cell from cellTravelList         
    
    &lt;b&gt;end if&lt;/b&gt;        

&lt;b&gt;end procedure&lt;/b&gt;

&lt;/pre&gt;

&lt;p&gt;
The actual &quot;&lt;i&gt;intelligence&lt;/i&gt;&quot; here is the in cost computation - the &lt;code&gt;computeCost&lt;/code&gt; procedure - 
since this is how we can influence the path followed by the snake.
&lt;/p&gt;

&lt;pre&gt;
&lt;b&gt;procedure&lt;/b&gt; computeCost (on cell)

    &lt;span style=&quot;color: green;&quot;&gt;-- if cell has a body part on it or the head of the snake&lt;/span&gt;
    &lt;span style=&quot;color: green;&quot;&gt;-- then return a ridiculously big value&lt;/span&gt;
    
    &lt;b&gt;if&lt;/b&gt; cell is not free &lt;b&gt;then&lt;/b&gt;
        &lt;b&gt;return&lt;/b&gt; 99999999;
    &lt;b&gt;end if&lt;/b&gt;
        
    &lt;span style=&quot;color: green;&quot;&gt;-- we want the snake as close as possible to its body&lt;/span&gt;
    &lt;span style=&quot;color: green;&quot;&gt;-- as a way to avoid partitioning of the board as much as possible&lt;/span&gt;
    
    bodyPartNearCount = count of parts of body in nearby cells 
    
    &lt;b&gt;if&lt;/b&gt; bodyPartNearCount &gt; 0 &lt;b&gt;then&lt;/b&gt;
    	
    	&lt;span style=&quot;color: green;&quot;&gt;-- dynamic cost&lt;/span&gt;
        &lt;b&gt;return&lt;/b&gt; 10000 / ((bodyPartNearCount * bodyPartNearCount) + 1);
        
    &lt;b&gt;end if&lt;/b&gt;
    
    &lt;span style=&quot;color: green;&quot;&gt;-- also favoring long walks on the border seems a good idea &lt;/span&gt;
    &lt;b&gt;if&lt;/b&gt; cell is close to the border &lt;b&gt;then&lt;/b&gt;
        &lt;b&gt;return&lt;/b&gt; 9000
    &lt;b&gt;end if&lt;/b&gt;
    
    &lt;span style=&quot;color: green;&quot;&gt;-- default value &lt;/span&gt;
    &lt;b&gt;return&lt;/b&gt; 10000;

&lt;b&gt;end procedure&lt;/b&gt;

&lt;/pre&gt;
</content>
    </entry>
    <entry>
        <id>https://www.niceideas.ch/roller2/badtrash/entry/snake-tt-0-2-alpha</id>
        <title type="html">Snake ! &lt;tt&gt;0.2-alpha-0.1&lt;/tt&gt;</title>
        <author><name>Jerome Kehrli</name></author>
        <link rel="alternate" type="text/html" href="https://www.niceideas.ch/roller2/badtrash/entry/snake-tt-0-2-alpha"/>
        <published>2010-02-23T17:40:58-05:00</published>
        <updated>2017-09-13T16:44:57-04:00</updated> 
        <category term="OpenGL" label="OpenGL" />
        <category term="c" scheme="http://roller.apache.org/ns/tags/" />
        <category term="c++" scheme="http://roller.apache.org/ns/tags/" />
        <category term="object-oriented" scheme="http://roller.apache.org/ns/tags/" />
        <category term="opengl" scheme="http://roller.apache.org/ns/tags/" />
        <category term="snake" scheme="http://roller.apache.org/ns/tags/" />
        <summary type="html">&lt;p&gt;
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.
&lt;/p&gt;
&lt;p&gt;
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.
&lt;br&gt;
Oh, and the snake it quite stupid at the moment. I wrote the &lt;i&gt;path finding&lt;/i&gt; algorithm in an hour or so and I really need to come up with something smarter.
&lt;/p&gt;

&lt;div class=&quot;centering&quot;&gt;
&lt;img class=&quot;centered&quot; alt=&quot;Snake screenshot&quot; src=&quot;https://niceideas.ch/roller2/badtrash/mediaresource/9b09370b-6ff9-49da-a412-5f213dd3fd7f&quot; /&gt;
&lt;/div&gt;
</summary>
        <content type="html">&lt;p&gt;
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.
&lt;/p&gt;
&lt;p&gt;
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.
&lt;br&gt;
Oh, and the snake it quite stupid at the moment. I wrote the &lt;i&gt;path finding&lt;/i&gt; algorithm in an hour or so and I really need to come up with something smarter.
&lt;/p&gt;

&lt;div class=&quot;centering&quot;&gt;
&lt;img class=&quot;centered&quot; alt=&quot;Snake screenshot&quot; src=&quot;https://niceideas.ch/roller2/badtrash/mediaresource/9b09370b-6ff9-49da-a412-5f213dd3fd7f&quot; /&gt;
&lt;/div&gt;
&lt;br&gt;

&lt;p&gt;
It still is a game as the &quot;user&quot; can at any moment deactivate the auto-pilot and take the control of the snake himself. This is a bit tricky though as the camera rotation makes it sometimes difficult to guess the directions mapping. (See hint at end of the post)
&lt;/p&gt;
&lt;p&gt;
The project is open-source&apos;d under GNU LGPL license and if you&apos;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.
&lt;/p&gt;
&lt;p&gt;
I&apos;m not providing any pre-built executable yet, only the source code :
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;https://niceideas.ch/roller2/badtrash/mediaresource/4beda957-5142-4d06-bf8f-f9af9c4a8a5e&quot; download=&quot;snake-0.2.alpha-0.1-src.zip&quot;&gt;snake-0.2.alpha-0.1-src.zip&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
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 &lt;code&gt;make&lt;/code&gt;. &lt;br&gt;
The project needs the following libraries : &lt;code&gt;libGL.so&lt;/code&gt;, &lt;code&gt;libXmu.so&lt;/code&gt;, &lt;code&gt;librt.so&lt;/code&gt;, &lt;code&gt;libGLU.so&lt;/code&gt;, &lt;code&gt;libglut.so&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
One can still compile it under windows with the help of the &lt;a href=&quot;http://www.cygwin.com&quot;&gt;cygwin&lt;/a&gt; project. Take care of selecting the above libraries at the package selection step of the cygwin installation process.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;User manual :&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;s&lt;/code&gt; - start/stop the camera rotation&lt;br&gt;
&lt;code&gt;o&lt;/code&gt; - turns the auto-pilot engine on/off&lt;br&gt;
When auto-pilot is turned off, one can use u, h, j, k to control the snake
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;Hint :&lt;/i&gt;When controlling the snake manually, the snake always starts by going up. This is useful in order to know where the camera (point of view) stands and to let the camera do its rotation until you actually see the snake going up. You can then stop the camera rotation (using &apos;&lt;code&gt;s&lt;/code&gt;&apos;) and control the snake.
&lt;/p&gt;
&lt;p&gt;
Happy snaking !
&lt;/p&gt;</content>
    </entry>
</feed>

