Sunday, March 18, 2007

Uno - A classic game

Though it is far away from any real play, I am still working on the animation and AI. The player can't make any move so far, but the computer can.

Right now the problem is coming in the painting of the client screen of the form. Though the form is invalidated (ideally, invalidation shouldn't be done manually in this simple interface) after loading the cards, it doesn't get refreshed.

Phew! I have really worked on the images - created all of them myself. Though they don't look excellent, but they resemble the new real cards. I hope this project finishes off quickly. It's real nice game. Maybe later on, I'll add the network play support. But first, let me win against the computer.

The rules are very simple ones, but I don't know the name. Maybe different types of Uno games will supported (though I haven't played others) once I get to know the rules. If you know some, please drop some comments. It will be really helpful! :)

Oh, in case you are wondering what is Uno, it's a card game for 2+ players. Check this and this for more details.

File: 2007-03-17 snapshot (removed)
Attachment type : Zip file
For compilation, needs .NET 2.0


  1. I have some suggestions that might help you.
    1. You're creating a lot of Bitmap-objects in your paint-routine. This is not really a good idea. Your paint-routine should be as fast and light as possible. Instead of creating new resized bitmaps and drawing them, you can draw the original bitmap scaled. Graphics.DrawImage has some overloads that let you specify the location and size you want to paint.
    2. I see you've put your images in a subfolder of the debug-folder. I think it would be better if you made your images embedded resources. Just right-click the project, select 'Properties' and go to the Resources-page. There you can click the little arrow next to 'Add Resource' and select Add Existing File. Visual Studio will automatically create a class for you to access the embedded images.

  2. Tommy:
    Thanks a lot for suggesting the ideas. I completely agree to your points and will do so. Very soon.

    But you see, first point is an optimization, and second is just a customization.

    Right now, the basic needs should be fulfilled - that is - the form should be painted correctly at right time.

    When I start a new game, the paint event is not happening! THAT's most urgent thing to cure now.

    But thanks for suggestions. I really appreciate it. :)


Talk to me :)