Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TriPegs - Classic triangle peg jumping game
#1
TriPegs is a clone of the wooden triangle peg jumping puzzle you often see on the tables at the crackle barrel restaurants here the US.  It's a very simple puzzle to play, you just jump over the pegs, removing the peg you jump over.  The goal is to leave only one peg on the board, which gives you the genius rating.  Have fun.

- Dav


.zip   tripegs-src.zip (Size: 146.46 KB / Downloads: 115)

   

Find my programs here in Dav's QB64 Corner
Reply
#2
This is incredible Dav. I made a 100% manual version today. Good job. https://qb64phoenix.com/forum/showthread.php?tid=747
Reply
#3
This is an evil game! Only once did I receive a 'Genius' and a 'smart'. I had to endure, on many occasions, having my game playing skills berated! To top it off... The game never started in the same position... Evil I tell you. Evil!

Looking forward to your next project!
May your journey be free of incident. Live long and prosper.
Reply
#4
Great game, Dav (and SierraKen)!
Maybe one day I'll progress above the "DUMB!" stage.
Reply
#5
Dav. Quick question:

Line #82 uses the '_COPYIMAGE()' command. I looked it up to see what it does but I do not know 'why' it was used. A little enlightenment if you would be so kind.... Thank you.

J
May your journey be free of incident. Live long and prosper.
Reply
#6
Thanks, @SierraKen, @PhilOfPerth, @johnno56!  Glad you're enjoying it.  I'm still usually an EG-NO-RA-MOOSE playing this.

johnno56, about the _COPYIMAGE call, what it's doing there is taking a snapshot of the screen to use (minus the peg being moved) while dragging that selected peg around the screen.  In the peg dragging DO/LOOP, I first _PUTIMAGE that snapshot (Line #90), then _PUTIMAGE the selected peg after it (line #91).  It keeps the board clean, just see the board with a single moving peg image.   Without using that _COPYIMAGE snapshot, the board will fill up with many moving peg images as you drag it around.

It's safe to comment out line #82 and run it to see what will happen without it, the screen will fill up with pegs.

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#7
Applied your suggestion. Your explanation and advice demonstrated the 'why'. Thank you Dav. Much appreciated.
May your journey be free of incident. Live long and prosper.
Reply




Users browsing this thread: 2 Guest(s)