public Form1() { InitializeComponent(); playerEgg = new Egg("Bowman"); PlayerName.Text = playerEgg.getName(); for (int i = 0; i < 3; i++) { errorMessagesTimers[i] = new Stopwatch(); } m0_HatchProgressBar.Maximum = playerEgg.getTimeToHatch(); mode = 0; Cat.Image = Catagatchi.Properties.Resources.Egg1; Cat.Location = new System.Drawing.Point(EGG_POS_X, EGG_POS_Y); wplayer.URL = "Resources\\music.mp3"; }
private void m0_BirthTimer_Tick(object sender, EventArgs e) { playerEgg.reduceTimeToHatch(1000); if (playerEgg.getTimeToHatch() == 0) { player_stage2 = new Player(playerEgg.getName(), true, ALLOWANCE, playerEgg.isLogo); hatchPlayer(playerEgg, player_stage2); } m0_HatchProgressBar.PerformStep(); double value = m0_HatchProgressBar.Value, max = m0_HatchProgressBar.Maximum; if (value / max > .6) { Cat.Image = Catagatchi.Properties.Resources.Egg3; } else if (value / max > .3) { Cat.Image = Catagatchi.Properties.Resources.Egg2; } }