Advertisement
Purianite

Form1.cs

Mar 10th, 2012
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Critter
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.             txtName.Text = pannya.Name;
  18.             txtHunger.Text = pannya.Hunger.ToString();
  19.             txtBoredom.Text = pannya.Boredom.ToString();
  20.         }
  21.  
  22.         Creature pannya = new Creature();
  23.  
  24.         private void btnEat_Click(object sender, EventArgs e)
  25.         {
  26.             pannya.Eat();
  27.             UpdateUI();
  28.         }
  29.  
  30.         private void btnPlay_Click(object sender, EventArgs e)
  31.         {
  32.             pannya.Play();
  33.             UpdateUI();
  34.         }
  35.  
  36.         private void btnTrick_Click(object sender, EventArgs e)
  37.         {
  38.             string Message;
  39.             int Result = pannya.getMood();
  40.             if (Result > 2)
  41.             {
  42.                 Message = pannya.PerformTrick();
  43.             }
  44.             else Message = "Your Pannya didn't feel like it.";
  45.             MessageBox.Show(Message);
  46.             UpdateUI();
  47.         }
  48.  
  49.         public void UpdateUI()
  50.         {
  51.             txtHunger.Text = pannya.Hunger.ToString();
  52.             txtBoredom.Text = pannya.Boredom.ToString();
  53.         }
  54.  
  55.         private void btnListen_Click(object sender, EventArgs e)
  56.         {
  57.             string Message = pannya.Talk();
  58.             MessageBox.Show(Message);
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement