Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. public MainWindow()
  2. {
  3. InitializeComponent();
  4. }
  5. Label pickupcoin = new Label();
  6. public void Start(object sender, RoutedEventArgs e) {
  7. bool startGame = true;
  8. if (startGame) {
  9. startButton.Visibility = Visibility.Hidden;
  10. Story.Text = "You have Entered a Room n pick a door";
  11. option1.Content = "Door 1";
  12. option2.Content = "Door 2";
  13. option1.Click += new RoutedEventHandler(walkThruDoorOne);
  14. option2.Click += new RoutedEventHandler(walkThruDoorTwo);
  15.  
  16. }
  17. }
  18.  
  19. public void walkThruDoorOne(object sender, RoutedEventArgs e) {
  20. Label pickupcoin = new Label();
  21. Story.Text = "You have walked throuh a door n that leads you outside n you can turn around or n keep walking";
  22. option2.IsEnabled = false;
  23. pickupcoin.Margin = new Thickness(100, 10, 0, 100);
  24. top.Children.Add(pickupcoin);
  25. pickupcoin.Content = "$5";
  26. pickupcoin.MouseDoubleClick += new MouseButtonEventHandler(pickupCoin);
  27. Story.Text = "Turn Around or keep wakling ?";
  28. }
  29.  
  30. public void pickupCoin(object sender, MouseEventArgs e) {
  31. currency.Content = "5";
  32. option1.IsEnabled = true;
  33. option2.IsEnabled = true;
  34. option1.Content = "Turn around";
  35. option2.Content = "Keep walking";
  36. Story.Text = "You have picked up $5";
  37. option1.Click += new RoutedEventHandler(turnAround);
  38. option2.Click += new RoutedEventHandler(keepWaling);
  39.  
  40. }
  41.  
  42. public void turnAround(object sender, RoutedEventArgs e) {
  43. Story.Text = "There is a monster n use your five dollars to power up";
  44. //This is the mouse event that needs to be overridden or something //
  45. pickupcoin.MouseDoubleClick += new MouseButtonEventHandler(powerUp);
  46.  
  47. }
  48.  
  49. public void powerUp(object sender, MouseEventArgs e) {
  50. Story.Text = "You now have an ability to punch";
  51. option1.IsEnabled = false;
  52. option2.IsEnabled = false;
  53. Label getPunch = new Label();
  54. top.Children.Add(getPunch);
  55. getPunch.Margin = new Thickness(20, 20, 20, 20);
  56. getPunch.Content = "POWER PUNCH";
  57. getPunch.MouseDoubleClick += new MouseButtonEventHandler(getPunches);
  58. }
  59.  
  60. public void getPunches(object sender, MouseButtonEventArgs e) {
  61. Story.Text = "Punch monser or die";
  62. option1.IsEnabled = true;
  63. option2.IsEnabled = true;
  64. option1.Click += new RoutedEventHandler(punchMonster);
  65. option2.Click += new RoutedEventHandler(die);
  66. }
  67.  
  68. public void punchMonster(object sender, RoutedEventArgs e) {
  69. Story.Text = "You have hurt the monster";
  70. //contnue
  71. }
  72.  
  73. public void die(object sender, RoutedEventArgs e) {
  74. Story.Text = "You have died";
  75. //continue
  76. }
  77. public void keepWaling(object sender, RoutedEventArgs e) { }
  78.  
  79. public void walkThruDoorTwo(object sender, RoutedEventArgs e) {
  80. Story.Text = "You have walked through a that leads n to a hall way you can walk down or walk to n the left door down the hall way";
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement