1 /* Pipepanic - a game. 2 Copyright (C) 2006 TheGreenKnight <thegreenknight1500@hotmail.com> 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 17 18 /* Global constants */ 19 /*#define DEBUG */ 20 #define FALSE 0 21 #define TRUE 1 22 #define VERSION "0.1.3" 23 #define DATADIR "/usr/local/share/pipepanic/" 24 #define DIGITS24BMP "digits24.bmp" 25 #define DIGITS48BMP "digits48.bmp" 26 #define TILES24BMP "tiles24.bmp" 27 #define TILES48BMP "tiles48.bmp" 28 #define ASCII15BMP "ascii15.bmp" 29 #define ASCII30BMP "ascii30.bmp" 30 #define RESOURCEFILE ".pipepanicrc" 31 32 #define MAGENTA 0xff, 0x00, 0xff 33 #define YELLOW 0xff, 0xcc, 0x66 34 #define WHITE 0xff, 0xff, 0xff 35 #define BLACK 0x00, 0x00, 0x00 36 37 #define GAMESHOWHELP 5 38 #define GAMEON 4 39 #define GAMECLEARDEADPIPES 3 40 #define GAMEFILLPIPES 2 41 #define GAMEFLASHHIGHSCORE 1 42 #define GAMEOVER 0 43 44 #define REDRAWALL (0xFFFF ^ (REDRAWPIPE | REDRAWTILE | REDRAWHELP)) 45 #define REDRAWHELP 256 46 #define REDRAWBOARD 128 47 #define REDRAWALLPIPES 64 48 #define REDRAWHIGHSCORE 32 49 #define REDRAWTIMER 16 50 #define REDRAWSCORE 8 51 #define REDRAWPREVIEW 4 52 #define REDRAWTILE 2 53 #define REDRAWPIPE 1 54 #define REDRAWNONE 0 55 56 #define BOARDW 10 57 #define BOARDH 10 58 #define GAMETIME 60 * 4 59 60 #define PIPEARRAYSIZE 105 61 #define PREVIEWARRAYSIZE 3 62 #define POINTSARRAYSIZE 75 63 64 #define LEAKYPIPEVAL +50 65 #define NULLPIPEVAL 255 66 #define DEADPIPEVAL 253 67 #define FILLEDCOUNTERBASE 20 68 69 #define PIPEOVERWRITESCORE -10 70 #define PIPEPLACEMENTSCORE 10 71 #define FILLNOWSCORE 5 72 #define DEADPIPESCORE -10 73 #define FILLEDPIPESCORE 50 74 75 #define CLEARDEADPIPESTIMEOUT 150 76 #define FILLPIPESTIMEOUT 200 77 #define FLASHHIGHSCORETIMEOUT 500 78 79 #define HELPPAGES 6 80 81 #define HELPPAGE0 "Instructions\n----------------\nConnect the green start pipe to the red end\npipe using the pipes from the green tile.\n\nThe more pipes you utilise the greater your\nscore.\n\nThe pipe network will be filled once the time\nexpires or you manually fill the network by\nclicking Fill or the green start pipe.\n\nThe game will end prematurely if a leaky\npipe is found when filling.\n\nClick High Score to view the high score's\npipe network." 82 83 #define HELPPAGE1 "Scoring\n----------\n10 points for each pipe placed.\n\n-10 points for each pipe overwritten.\n\n5 points for each second remaining if you fill\nthe network early.\n\n-10 points for each unconnected pipe found\nwhen filling.\n\n50 points for each filled pipe." 84 85 #define HELPPAGE2 "Pipe Frequency\n--------------------\nThe pipes appear on the preview bar\nshuffled from a set frequency. Every 105\npipes will include the following :-\n\n28 corner pieces\n20 T pieces\n18 vertical pipes\n18 horizontal pipes\n16 terminators\n5 crosses" 86 87 #define HELPPAGE3 "Strategy\n------------\nFamiliarise yourself with the pipe frequency.\n\nAttempt to utilise every pipe offered to you\noverwriting as few as possible.\n\nBuild speedily and occupy as much of the\nboard as you can.\n\nReserve part of the board for placing the\ncorner pieces, creating a winding snake from\none side to the other.\n\nFilling early rewards a bonus." 88 89 #define HELPPAGE4 "Keys\n-------\nEsc (Cancel on the Zaurus) exits Help and\nthe game.\n\nLeft & right keys navigate Help.\n\nPrimarily the game is mouse/stylus driven." 90 91 #define HELPPAGE5 "Licence\n-----------\nThe source code is licenced under the GNU\nGPL v2 - http://www.gnu.org/copyleft/gpl.html\n\nThe artwork is licenced under the Free Art\nLicence - http://artlibre.org/licence/lal/en/\n\nPipepanic\nCopyright 2006 TheGreenKnight\nthegreenknight1500@hotmail.com\n\nhttp://thunor.org.uk/pipepanic\n\nVersion " VERSION 92 93 94 95