Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
I want to program a simple card game in VB.NET. When I first did it in 2003 (In regular VB) I used PictureBox. But now a want a bit more advanced version were cards can rotate. The more I look into the subject the more I get confused.
 
GDI is more advanced but does not have rotation. GDI+ have it and is readilly available in .NET. But both GDI and GDI+ are not hardware accelerated and sluggish (especially laggy in Vista/Win7). It is recommended to move over to WPF.
 
But WPF is for flashy application and not for games. And DirectX is recommended to be used for games.
 
The only DirectX for VB.NET from what I remember was Managed DirectX and according to a post earlier this year, it died 6 years ago. Now it is recommended to use XNA or OpenGL.
 
In the end, I want 2D cards that can rotate. I have no need for 3D. So what should I use ? And the card game could have 156 cards (3 decks) drawn at the same time (well of course I only draw the top-most card from the deck pile).
 
Finally, I want to be able to play it on both my WinXP and Vista computers.
Posted 5-Oct-10 10:12am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use XNA, this has all the stuff that you need without going into the 3d portion of the API..
 
and in the long run if you want to do things like sparkles, music, explosions.. or whatever else to augment your game you would have easy access to that stuff through XNA.
 
GDI, and it pains me to say this is practically dead, DirectX or OpenGL would be more useful to you, but are VERY complicated, and for where you seem to be in your education XNA is just the thing for you.. (it also has 2s rotation built in!!!)
 
first thing you will need to get accustomed to is that images (the 2d ones) are called textures.. specifically Texture2D... you can find lots of resources for this, and should you get stuck the guys and gals @ the XNA forums are very helpful... plus there are plenty of tutorials on line, samples, and books...
 
Good Luck - (I am the leader of an XNA user group.. so I might be biased) Cool | :cool:
  Permalink  
Comments
lrroberb at 6-Oct-10 14:04pm
   
After more research, I found a great tutorial from Alan Phipps on VB.NET XNA. I also found an article on rendering XNA inside a window Form to make available regular controls that looks promising.
Thank you :)
Dalek Dave at 25-Nov-10 4:43am
   
Good Call!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Nothing against XNA, but WPF would be better for this. A card game may need not much of a GUI, but some may be needed and that would be a pain, especially for somebody who just got started.
 
With WPF you get the user interface and also the cards (including transformations) with far less overhead.
  Permalink  
Comments
lrroberb at 27-Nov-10 18:53pm
   
Thank you for your input. After seeing a very good card game on a flash-game website, I might go for WPF because flash is web-only. I might give it a shot next weekend with the Cards Game Library (http://www.codeproject.com/KB/game/Cards_Game_Library.aspx?msg=3107905). But for now, the XNA is working well. Quite hard at the moment but it will get better later if I want to add more features.
CDP1802 at 29-Nov-10 3:50am
   
Please don't get me wrong. I like XNA and at the moment I'm writing a graphics engine for the little game I'm working on. Of course it's up to the task of displaying playing cards and even a bit more. The hard part you mention probably is to set up XNA to render the objects you need. WPF would be less of a pain and you could concentrate on implementing your game. And it also offers everything you may need.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Have a look at the cardgame starter kit on Microsoft. It might help, but at least you have the playing card pics.
 
Hope it helps
 
Regards Zelacat
  Permalink  
Comments
lrroberb at 27-Nov-10 18:25pm
   
The starter kit was great to introduce me to a different approach to the card-game mechanics. But I don't like that it relies on a PictureBox control for every drawn card (I want rotation).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 520
1 Mathew Soji 335
2 BillWoodruff 260
3 OriginalGriff 215
4 Afzaal Ahmad Zeeshan 188
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,028
3 Manas Bhardwaj 4,539
4 Maciej Los 3,845


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 27 Nov 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100