Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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:
 
Share this answer
 
Comments
lrroberb 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 25-Nov-10 4:43am    
Good Call!
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.
 
Share this answer
 
Comments
lrroberb 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.
[no name] 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.
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
 
Share this answer
 
Comments
lrroberb 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900