Spider Solitaire:
For my first Windows game I decided to do Spider Solitaire, which has
been a favorite game of mine for years. It was originally done in MFC for
a Microsoft Windows Programming with Visual C++ class, but it had nasty
flicker due to lack of double buffering. So I decided to learn DirectX and
redo it in that. I not only switched all the graphics to DirectX, but I
also tossed out MFC entirely and redid the entire game in Win32, and it
actually turned out to be a lot easier. Fortunately I was able to reuse
large portions of code from the old game, and what I did modify got
cleaned up substantially from the original.
(3/22/2004)
I was hoping to work on this more but I started taking Computer Science classes at
a local community college and also applied to USC to go for a second
bachelors in Computer Science, so I haven't had as much time to work on
it as I hoped. But I did fix a pretty nasty bug, which was causing the
game to only work on computers with their resolution set to 1600x1200.
It now works in all resolutions. So I decided to do a quick upload
before I head off to the Game Developer's Conference tomorrow night.
Download Spider Solitaire version 0.06 (requires DirectX 8.1)!
Executable
version
(Unzip all files with directories and double-click spider.exe to run. I'll
work on an installer later)
Source code for Visual
C++ 6
(5/11/2003)
This weekend I spent some time doing cleanup and bug fixes in
preparation for E3 (I'll be there on Thursday, and will bring cds).
New this version:
- Fixed bug when you get down to the last card in a stack (clicking on
it was crashing the program previously)
- Fixed bug where Save Game wasn't working (When there was no file it
was coming up as Read Only)
- Added an icon for the game executable
- Created an SGV logo icon (for the cd)
- Re-commented a couple more classes
- Fixed a problem with my distribution process (Visual C++ was putting
the files in the wrong directory so the original versions of the last
version's source code had older versions in them by mistake. I've
since fixed that file and re-uploaded it.
Download Spider Solitaire version 0.05 (requires DirectX 8.1)!
Executable
version
(Unzip all files with directories and double-click spider.exe to run. I'll
work on an installer later)
Source code for Visual
C++ 6
(4/20/2003)
This update took longer because of Game Developer's Conference, a week+
trip to NY, and other things that kept me busy for a few weeks, but here
it is.
New this version:
- You can now play by clicking and highlighting a card and then
clicking where you want it to go.
- Fixed so when you drag a card it follows the mouse much more closely
without jumping. It's still slightly off and drags behind the mouse if
you drag the mouse really fast, but it's much better.
- Redid code commenting in a couple more classes.
Download Spider Solitaire version 0.04 (requires DirectX 8.1)!
Executable
version
(Unzip all files with directories and double-click spider.exe to run. I'll
work on an installer later)
Source code for Visual
C++ 6
(3/04/2003)
New this version:
- Added About Box
- Added Save/Load Game functionality. It can be done via the menu and
it asks if you want to save game on exit, and if it finds a save file
when you open the program it loads it automatically. It also checks if
you're on a cd-rom drive or if the file is read only and doesn't save.
- More graphics code cleanup
- Fixed screen flicker when resizing or when scrollbars appear.
- Added ReadMe.txt with instructions on how to play
- Now have macros to help with distribution.
Download Spider Solitaire version 0.03 (requires DirectX 8.1)!
Executable
version
(Unzip all files with directories and double-click spider.exe to run. I'll
work on an installer later)
Source code for Visual
C++ 6
(2/23/2003)
I did some major work over the past 2 weekends, but I didn't post last
week because I wanted to finish some things that were in progress, so this
is a major upgrade to the last version. Added to this version:
- Added scrollbars and made them show up automatically when the cards
reach the bottom of the screen. I also fixed the mouse code so it will
work even when you're scrolled down.
- Also fixed so resizing the window just displays more of the screen.
- Did major cleanup of large parts of the Direct3D code
- Added a timer to check for time until next frame before processing
the game in an attempt to keep the game from hogging the CPU. It seems
to have helped with the lag in the game itself.
- Added debug code to display mouse position
- Started redoing comments with the help of macros.
- Fixed drawing of finished stacks so when you drop a full suit it
displays the ace (I missed that in the last version)
- Did a lot of testing and managed to win a game so I was finally able
to determine for sure that the winning game code works!
- Added code to Visual SourceSafe.
- Created better temporary images for Jack, Queen and King.
Still in progress/known bugs:
- Game still sucks up lots of CPU time and slows down the machine when
you alt-tab to another application. I'm working on this.
- Screen goes white when scrollbars appear and flickers when you're
resizing the window. I'm working on this too.
- Need to finish Direct3D cleanup (converting the functions to draw
Jack/Queen/King, etc.)
- Still need to add Save/Load game
- Still needs About box
- Needs Windows Help file on how to play the game (pointed out by my
mother)
- More features (see below)
Download Spider Solitaire version 0.02 (requires DirectX 8.1)!
Executable
version
(Unzip all files with directories and double-click spider.exe to run. I'll
work on an installer later)
Source code for Visual
C++ 6
(2/10/2003)
I finally have a fully functional game to put up here! This still needs
a lot of work, but the major graphics and functionality are there
Known bugs/things to be worked on:
- Need to get scrollbars/resizing window working. Right now resizing
the window just stretches the cards and breaks the mouse checking
code. This is my first priority
- J,Q, and K images look pretty lousy. They were just quicky images I
made up and the fix is a simple image swap, so I'm not really worried
about it.
- Dragging cards seems to be slightly off. I tried to keep the card in
the same position relative to the mouse as it's dragged but I noticed
today it's not quite right. It's not a big deal but I'll look into it.
- Save/Load game functionality haven't been added yet. I had it in the
MFC version using serialize but it was a mess. I've worked out a much
cleaner way to do it for this version, but I haven't gotten to it yet.
- About box not working. I'll get to that.
- More features: I plan to add more features like adding your name,
keeping some kind of score (specifics still need to be worked out),
versions of the game with different amounts of decks (right now only a
2 deck version is supported), possibly allowing multiple card backs,
etc.
Download Spider Solitaire (requires DirectX 8.1)!
Executable
version
(Unzip all files with directories and double-click spider.exe to run. I'll
work on an installer later)
Source code for Visual
C++ 6
|