Click here to Skip to main content
15,887,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi everyone,
I am a newbie in xna game .
My trouble is having a group of sprites and i want to change its state by second, as after 10 seconds one of them will change from a bush to a tree in 5 seconds then change to bush. In next 10 seconds of previous sprite will change.
i merely want know how to make it.
Please give me a hint or a tutorial to know how to do it.
Thx everyone in advance.
Please help me.
(sr for my bad english)
Posted
Updated 12-Oct-11 16:29pm
v3

1 solution

Are you saying you want to change a bush to a tree, or is that a bug that you are trying to fix?

If it is the first one, you would have multiple groups of sprites (or tilesets), and have an enum in your class stating which tileset you are currently using.

Then, you use DateTime.UtcNow to store the last change-tileset time, and when ten seconds have elapsed, you change your tileset.

Cheers,

ge-force.

P.S. If you are doing a platformer, check out the Platformer Starter Kit from the App Hub (http://create.msdn.com/en-US/education/catalog/sample/platformer[^])

It has lots of good information on tile set animation.
 
Share this answer
 

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