-3

I am developing a card game using WPF and since i do not have any knowledge about animations i would like to know if someone could help me in how to write an animation to simulate a Card ( Image ) been played over a table.

At the bottom and top of my game table i have my cards on vertical position. At the right and left my cards are on horizontal position.

What i really want is give an impression that a human is selecting and throwing the card.

2 Answers2

3

Since your question is pretty open-ended, I'll give you an open-ended start...

Look into Storyboards, and how to use the same to modify the RenderTransform of your Card UserControl.

Your first step should really just be animating your card's position from its initial spot to the center of the table. As an additional hint (which will come in handy after you've learned about Storyboards), your DoubleAnimation.From property does not need to be specified. You just need to specify the DoubleAnimation.To property.

K Mehta
  • 10,323
  • 4
  • 46
  • 76
2

I see questions like this all the time on SO, and it really does give the impression of "I haven't tried, and I have not read anything". You already have your cards on the table (so to speak), and the question is, make it look like a human did it.

There are a variety of ways, some cheap and simple, some more complex and involved. You won't know the answer until you try.

For example, perhaps you want a card to go from one position to another (optionally flipping). You have varying degrees of difficulty here:

  1. Move the card to the position, as is. Cheap and easy. You could even use the distance between the source and the target to determine the speed to have some kind of residual momentum.

  2. Cards are at different angles. How do we rotate? XNA makes this pretty simple, have you looked up on XNA and general rendering? Or do you want to this purely using WPF?

  3. Does the move involve showing the card face-up, or not? Will there be an animation involved? Are you happy with just the face changing or do you want to see an actual "flip"? If it's the latter than some kind of a plane in XNA using 3D might be better, at least then you can have two faces with two different textures.

What I am saying is, and why this is an answer as opposed to a comment, is that you have given no indication of anything that might be considered trying to solve the problem. You seem like you've got halfway there, you've already got cards rendered on the screen. But to ask "Make it look like a human put a card in"...? Well, sorry... it's not that simple. You can make this task as easy or had as you wish.

Moo-Juice
  • 38,257
  • 10
  • 78
  • 128
  • Ok ! I hava a PayPal account and i want to pay someone that could do this animation with a very professional look and feel. – user1095623 Dec 15 '11 at 16:30