Recent

Author Topic: Klondike solitaire Part 2  (Read 1162 times)

TBMan

  • Sr. Member
  • ****
  • Posts: 355
Klondike solitaire Part 2
« on: August 15, 2025, 06:42:23 pm »
https://www.youtube.com/watch?v=qaFGzI3K2Rc


So the game is pretty much finished. I want to add a hint feature. The game lost logic isn't in it yet. I'll add that soon. It does detect a won game and I put in a hot key so I could  show the "celebrate game won" animation in the video. I may add more celebrations like some of the other solitaire games do. There's a couple of other things I want to tweak, but basically this is it. In the video I'm demonstrating 3 different decks which I made just for the fun of it.

I had a lot of fun coding this game. Most of the card deck sprites on the internet have to be purchased, but I managed to find some free ones. I used jpg files that had all the cards displayed in one large file. Sometimes the images had card backs also. I loaded the jpg file using code I found that displays a jpg using PTCGraph and I grabbed the palette, saved it, and then read the individual cards, saved them individually using my own sprite format and also exported the sprites as arrays in text files to be included in units. For the last deck I made, I generated include files for the suit units that just included the individual sprite arrays.  I also customized my sprite editor as different versions for each deck so I could edit the sprites as needed and export the changes. For the last deck I can just edit, export and then just rebuild the solitaire program to reflect the changes. No more cutting and pasting of text files, lol.

My next project is going to be Spider Solitaire. I'll start that this coming week.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

graavan

  • Newbie
  • Posts: 2
Re: Klondike solitaire Part 2
« Reply #1 on: May 16, 2026, 04:41:59 pm »
Hey TBMan!
Just curious how far have you gotten with the Spider version of solitaire? Copilot and I have really been vibing together in creating one myself. I have the game mechanics working with a nice menu system, able to have different players, currently working on stats tracking and then will have an engine for the computer to solve the game itself.

I know this thread is 9 months old, but perfectly timed for me now.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: Klondike solitaire Part 2
« Reply #2 on: May 17, 2026, 03:50:07 am »
https://www.youtube.com/watch?v=qaFGzI3K2Rc


So the game is pretty much finished. I want to add a hint feature. The game lost logic isn't in it yet. I'll add that soon. It does detect a won game and I put in a hot key so I could  show the "celebrate game won" animation in the video. I may add more celebrations like some of the other solitaire games do. There's a couple of other things I want to tweak, but basically this is it. In the video I'm demonstrating 3 different decks which I made just for the fun of it.

I had a lot of fun coding this game. Most of the card deck sprites on the internet have to be purchased, but I managed to find some free ones. I used jpg files that had all the cards displayed in one large file. Sometimes the images had card backs also. I loaded the jpg file using code I found that displays a jpg using PTCGraph and I grabbed the palette, saved it, and then read the individual cards, saved them individually using my own sprite format and also exported the sprites as arrays in text files to be included in units. For the last deck I made, I generated include files for the suit units that just included the individual sprite arrays.  I also customized my sprite editor as different versions for each deck so I could edit the sprites as needed and export the changes. For the last deck I can just edit, export and then just rebuild the solitaire program to reflect the changes. No more cutting and pasting of text files, lol.

My next project is going to be Spider Solitaire. I'll start that this coming week.

Is it open source?

TBMan

  • Sr. Member
  • ****
  • Posts: 355
Re: Klondike solitaire Part 2
« Reply #3 on: May 21, 2026, 04:16:40 pm »
Hey TBMan!
Just curious how far have you gotten with the Spider version of solitaire? Copilot and I have really been vibing together in creating one myself. I have the game mechanics working with a nice menu system, able to have different players, currently working on stats tracking and then will have an engine for the computer to solve the game itself.

I know this thread is 9 months old, but perfectly timed for me now.

I did Spider some time ago, but I basically stopped posting about card games here as it seemed no one was interested. Spider is one of my favorites to play. I've done 78 card games in total, which includes Uno, Jacks or Better and 2 versions of Pyramid solitaire.

My code for these games over time became very consistent which made it easy to create new ones. 
Here's a new demo of the Spider game:

https://youtu.be/fxIK2J-G5q4

I used ChatGpt to code the graphic engine that I use. It is based on PTCGraph (which is based on Borland's Graph unit).

Recently I re-coded Klondike to follow my code structure in my other games.
« Last Edit: May 21, 2026, 04:41:57 pm by TBMan »
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

TBMan

  • Sr. Member
  • ****
  • Posts: 355
Re: Klondike solitaire Part 2
« Reply #4 on: May 24, 2026, 03:31:02 pm »

Is it open source?

No, I don't share my code. What I do is very straight forward and easy to duplicate. Almost all of
the games I write are based on versions that are free to play on the 'net.

Not one person has ever asked how to do the data set up for any of the solitaire games I have written so I suppose
it is something that even beginners know how to do.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

tooknox

  • New Member
  • *
  • Posts: 37
Re: Klondike solitaire Part 2
« Reply #5 on: May 24, 2026, 04:46:50 pm »
Hey man, btw where can I download your games. Also, Just a suggestion, if not every game you make you can make one or two open-source just as learning exercise for new pascal programmers.

Seenkao

  • Hero Member
  • *****
  • Posts: 759
    • New ZenGL.
Re: Klondike solitaire Part 2
« Reply #6 on: June 03, 2026, 10:27:30 pm »
tooknox, hi!

посмотри по ссылкам ниже и посмотри по форуму. Здесь немало выложено игр с исходным кодом. И не только игр.

--------------------------------------------
Google translate:
Check out the links below and the forum. There are quite a few games with source code posted there. And not only games.

https://forum.lazarus.freepascal.org/index.php/topic,69726.msg542154.html#msg542154
https://wiki.lazarus.freepascal.org/Portal:Game_Development
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

 

TinyPortal © 2005-2018