Pipes Game 5x5 to 9x9

(Simon) #1


A version of the classic pipes game where you must lay pip between each pair of nodes without the pipes crossing each other. This version has puzzles ranging from 5 x 5 to 9 x 9.

Game Play

The initial splash screen is animated and shows pipes being layed. The user can skip this and jump straight to the action by pressing the ‘A’ button. The ‘B’ button toggles the sound on and off.

The game has six levels ranging from super easy to hard. The easy puzzles have a 5 x 5 cell configuration and they increase in size to 9 x 9. Press ‘A’ to select a level or ‘B’ to return to the front splash screen.

Depending on the level chosen, the board may fit onto the screen or you may need to scroll up and down to see the action. Pressing ‘A’ on a node will select that node.

Pressing the ‘B’ button will return you to the level select if no node has been selected. Alternatively, if a node has been selected, pressing ‘B’ will erase the pipe that is currently being layed.

Source Code

Eried's Unofficial Repo :)
(Scott) #2

Since you’ve got plenty of code space left over, I suggest you change arduboy.boot() to arduboy.begin() in setup(), to enable all the Arduboy boot up features. If you do switch to arduboy.begin() you sould remove the arduboy.audio.begin() call since it will be called by arduboy.begin().

I also suggest that you change all EEPROM.write() calls to EEPROM.update() to avoid unnecessary EEPROM writes.

You may also wish to turn on all compiler warnings and address the ones that your code is generating.
In the Arduino IDE:
File > Preferences
Select Show verbose output during: compilation
Select Compiler warnings: ALL

(Scott) #3

It would be nice if the D-pad buttons had auto-repeat when held.

(Simon) #4

Thanks for the feedback @MLXXXp.

I meant to put begin() back in as I only removed it for testing. I wasn’t aware there was an Update() call - maybe I should read the instructions!

I will also have a look at the compiler warnings.

(Scott) #5

Just an F.Y.I., if the reason you use boot() during development is because you don’t want to always have to wait for the logo sequence to end, you can abort the logo by pressing the Right D-pad button, either while powering up or while the logo is scrolling down.

(Erwin) #6

Is Pipes the name for your game?

Added your game to http://arduboy.ried.cl

(Pharap) #7

I really miss simple puzzle games like this.
I forgot these even exist for the most part.

Good job.

(Simon) #8

Thanks for your feedback all

@MLXXXp - I was aware of the right-button shortcut but I am just lazy. I have compiled with ‘verbose’ and do not see anything that I need to address. Did you do this? Am I not doing it correctly or am I missing something??

@eried - Yes its simply called ‘Pipes’ although the repository is called ‘Laying Pipes’. In the English language that is a euphemism for … I’ll let you look it up on Urban Dictionary. Anyhow, my Domino and this Pipe game have know both been updated since you uploaded them to your site. Can you please refresh??

@Pharap - Thanks man. I like puzzle and board games more than action ones and think they are better suited to these small devices. Plus my small brain can only program simple things!

(Pharap) #9

If the first game is ‘Laying Pipes’ the sequel should be ‘Series Of Tubes’ (SFW).

I like puzzle and action games in equal measure (sometimes at the same time - I really love Portal) but I agree that puzzle games are well suited to the Arduboy and I think it’s a shame there aren’t more puzzle games for it.

(Scott) #10

Here are the warnings I get when Compiler warnings: All is set in the IDE preferences:

/home/xx/Arduino/LayingPipe/LayingPipe.ino:110:3: warning: missing initializer for member 'Node::value' [-Wmissing-field-initializers]
/home/xx/Arduino/LayingPipe/LayingPipe.ino:110:3: warning: missing initializer for member 'Node::value' [-Wmissing-field-initializers]
/home/xx/Arduino/LayingPipe/Play.ino: In function 'bool validMove(byte, Node, byte, byte)':
/home/xx/Arduino/LayingPipe/Play.ino:488:9: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   if (x < 0 || x >= puzzle.maximum.x || y < 0 || y >= puzzle.maximum.y) return false;
/home/xx/Arduino/LayingPipe/Play.ino:488:43: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   if (x < 0 || x >= puzzle.maximum.x || y < 0 || y >= puzzle.maximum.y) return false;
/home/xx/Arduino/LayingPipe/Utils.ino: In function 'bool clearBoard(byte)':
/home/xx/Arduino/LayingPipe/Utils.ino:134:1: warning: no return statement in function returning non-void [-Wreturn-type]
/home/xx/Arduino/LayingPipe/Utils.ino: In function 'byte getNumberOfPuzzles(byte)':
/home/xx/Arduino/LayingPipe/Utils.ino:261:1: warning: control reaches end of non-void function [-Wreturn-type]

(There are also some warnings generated by the EEPROM library but you don’t need to deal with these.)

(Simon) #11

Ahhh … I set ‘Show verbose output’ on compilation’ not ‘Compiler warnings: All’. I see them now.

I am a little bit special sometimes.

(Simon) #12

I have fixed the issues and re-submitted!

(Erwin) #13

I updated your two games

(Simon) #14

Thanks Erwin. One day (soon) I will build my own HEX files.

(Pharap) #15

In fairness I think “no return statement in function returning non-void” should really be an error rather than a warning and that maximum warnings should probably be on by default.
The x < 0 and y < 0 mistakes are pretty easy to make, those are good warnings.

(Simon) #16

Yeah I agree - that would be an error in any other language.

(Kyran Bullard) #17

I can’t get past level 7 on practice. There are 4 square boxes and when I complet one line and try to do the next, it deletes the line I just laid down

(Simon) #18

@Kyran … yep. That’s some shoddy testing by the developer. I have fixed it - the puzzle definition was wrong - and I am just retesting. Hope to refresh the game tonight.

(Simon) #19

@Kyran … fixed. Sorry about the old version.

I am not sure where you got the code from - @eried site or my repository but it is updated in my repository. I have rebuilt the hex file and the .arduboy file.

(Kyran Bullard) #20

Where is your repository? I need the hex file