Click here to Skip to main content
15,033,147 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi people


i am trying to make a matching game with storyboards.

i made it in blend and using visual studio.

i am triggering the storyboards from the code behind.

i am using storyboard.completed to match two pictures when they match they disappear with a timer.

i am also using storyboard .completed to make the storyboards go back to the start if they don't match.

it works but my problem is if they don't match = (storyboard.stop) it gos back to the stat like it should but then on the second click it always gos back to the start ? i need it to reset so you can try different ones ?

here is the code =



C#
        private void click1(object sender, StylusDownEventArgs e)
{
        Storyboard monkyspin = (Storyboard)FindResource("monkyspin");

        Storyboard catspin = (Storyboard)FindResource("catspin");

        monkyspin.Begin();
        catspin.Completed +=if_cat_cop_stop;

     }


     private void if_cat_cop_stop(object sender, EventArgs e)
    {
     Storyboard monkyspin = (Storyboard)FindResource("monkyspin");
     monkyspin.Stop();
     monkyspin = new Storyboard();
     Storyboard catspin = (Storyboard)FindResource("catspin");
     catspin.Stop();
     catspin = new Storyboard();
     }

and i do the same but the other way round for button 2

any ideas ?
Posted
Updated 6-Mar-14 20:27pm
v2

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