PDA

View Full Version : I hate threads but can I rewrite this source code??


MrSeanKon
03-03-2008, 06:03 AM
First of all check this thread (http://www.aoaforums.com/forum/programming-and-assembly-language/44459-only-threads.html#post470048) cos I uploaded there the part of the cardgame source code and one video.
It's a C# code.
Well what can I do?? :rolleyes:

Kreij
03-03-2008, 06:43 PM
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
03-05-2008, 06:43 AM
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.
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
03-05-2008, 12:12 PM
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
03-17-2008, 08:59 AM
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
03-17-2008, 12:26 PM
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
04-04-2008, 11:04 AM
No mate but is it easier?:twitch:
Well I am not a professional programmer; I am 35 years old and I cannot read new stuff like a student!

Kreij
04-04-2008, 01:29 PM
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. :toast:

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 (http://blogs.msdn.com/coding4fun) pages. There is also a ton of information on the DirectX (http://msdn2.microsoft.com/directx/) and XNA (http://msdn2.microsoft.com/xna/default.aspx) sections.