Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Critter
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- txtName.Text = pannya.Name;
- txtHunger.Text = pannya.Hunger.ToString();
- txtBoredom.Text = pannya.Boredom.ToString();
- }
- Creature pannya = new Creature();
- private void btnEat_Click(object sender, EventArgs e)
- {
- pannya.Eat();
- UpdateUI();
- }
- private void btnPlay_Click(object sender, EventArgs e)
- {
- pannya.Play();
- UpdateUI();
- }
- private void btnTrick_Click(object sender, EventArgs e)
- {
- string Message;
- int Result = pannya.getMood();
- if (Result > 2)
- {
- Message = pannya.PerformTrick();
- }
- else Message = "Your Pannya didn't feel like it.";
- MessageBox.Show(Message);
- UpdateUI();
- }
- public void UpdateUI()
- {
- txtHunger.Text = pannya.Hunger.ToString();
- txtBoredom.Text = pannya.Boredom.ToString();
- }
- private void btnListen_Click(object sender, EventArgs e)
- {
- string Message = pannya.Talk();
- MessageBox.Show(Message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement