I am trying to create a game in using wp7 ( windows phone 7 ).
I have a thread that randoms create storyboards which moves from the top to the bottom of the phone. Thats the “computer”, now i have the “player” , and i want to know when one of the storyboards overlaps the player or come very close.
Is there a way to control the storyboard and know when the “computer” and the “player” overlaps? Like listening to an event that triggers everytime the storyboard changes position and then check if storyboard.pos == player.pos ?
Thank you!
You can use the CompositionTarget.Rendering event which fires every frame to check this, or in Windows Phone 7.1 you can create a GameTimer (you need to include a reference to the Microsoft.Xna.Framework.dll in your assembly for this to work in Silverlight) and put your logic in there. Generally if you’re doing collision detection in a game it’s easier to not use storyboard animation and instead use one of the techniques above to do your own procedural animations, then you know exactly where the element is at any given time.