Page 1 of 1

FlowSnake - A Snake Game Using Flowcode

Posted: Fri Dec 09, 2016 4:49 pm
by Benj
Hello,

I've been working in my spare time on a LED lamp which features several animations. One of those animations was an automated AI game of snake. As I had done the work anyway I thought I would clean up the code a little, add a few comments and way for up to 4 players each to control a snake and share with you all.


Here is a version of the game designed to run on a PIC16F1937 device and the EBM001 graphical display with 0-4 human players.
Snake.fcfx
(122.32 KiB) Downloaded 522 times
Snake1.jpg
Snake1.jpg (53.14 KiB) Viewed 4240 times
Snake2.jpg
Snake2.jpg (87.78 KiB) Viewed 4240 times

The controls are listed by the switches. Player 1 controls are W,A,S,D, or the P1 switches.

The Player 1 controls are also used to navigate the menus. W and S change the value and D allows you to proceed.


The panel properties allow the game to be configured in a number of different ways.

For microcontrollers with bigger memories you can allow the snakes to be significantly larger. Remember to change both the MaxSnakeLength property and the SnakeCoords variable array size.

The EBM001 screen can be easily changed for another colour gLCD.

To do this simply drag the LCD component you want to use onto the panel and then select and right click the EBM001 display. Choose the Selection -> Replace items from the right click menu.
The LCD you dragged on should then be available from the list that appears.
To finish just delete the unused graphical LCD component.


My next job is to design a simple veroboard board to allow up to 4 players to compete together.

Enjoy.