# I hate threads but can I rewrite this source code??



## MrSeanKon (Mar 3, 2008)

First of all *check this thread* cos I uploaded there the part of the cardgame source code and one video.
It's a C# code.
Well what can I do??


----------



## Kreij (Mar 3, 2008)

Hi MSK,

When exactly to you get the bad animation? Is it only when you click a card?
When the cards are dealt it seems okay (looks like you are using the same routine to move cards in both cases).
Does this happen when you are using seperate threads or when you are not?
You post on AOA was not exactly clear to me.


----------



## MrSeanKon (Mar 5, 2008)

Kreij when I click on a playing card I see this terrible animation.
Did you download the source code??
Cos you have Visual Studio thus you can play with it easily.


Kreij said:


> Does this happen when you are using seperate threads or when you are not?


I have not tested this but I think it does not happen.


----------



## Kreij (Mar 5, 2008)

Hi MSK,

I did download both the "bad animation" avi and the source code.
The source code runs fine for me. When I click on a card, the animation is smooth, and there is no graphical corruption like in your avi.

I'm running it on a P4D 3.0 with integrated graphics.


----------



## MrSeanKon (Mar 17, 2008)

Thanks again for your effort sorry for my ignorance (cos I am AMD fan) your CPU is dual core?
What's your video card??
Anyway cos I am not sure I will continue using threads....


----------



## Kreij (Mar 17, 2008)

Yes, CPU is a Pentium 4 Dual Core 3.0GHz w/ 2GB of RAM
Video card is a Radeon X300/X550 128MB (324MHz Code / 196MHz MEM)
OS is XP Pro SP2

Just out of curiosity, MSK, have you ever considered abandoning the windows form application and writing the whole thing in DirectX(Xna) ?  Much better having a game loop handle animation than bumping picturebox locations.


----------



## MrSeanKon (Apr 4, 2008)

No mate but is it easier?
Well I am not a professional programmer; I am 35 years old and I cannot read new stuff like a student!


----------



## Kreij (Apr 4, 2008)

Well, I wouldn't say that it's any easier, but I also wouldn't say it's harder.
You would have to learn about DirectX and how it works, but for 2D applications (as opposed to 3D) it's pretty straight forward. 

The advantage of moving to DirectX would be that if you ever wanted to add something 3D to the game, you would have the foundation to do so.

35? Pffft ... I getting close to 50 and I still learn new stuff every day. 

Oh, one thing. If you want to try out XNA studio, you need to use VS2005 (or the 2005 express editions). XNA is not compatible with 2008 yet.
You can use the DirectX libraries from any version.
You can do everything in pure DirectX programming that XNA give you, XNA just makes it easier by automatically coding certain things for you.

There are a bunch of good articles on MSDN's Coding4Fun pages. There is also a ton of information on the DirectX and XNA sections.


----------

