예제 #1
0
        private async void FriendDepressed()
        {
            await DisplayAlert("Depressed", "Your friend has left you", "New Friend");

            friend.Xp = 0;
            friend.CurrentFriendState = FriendState.happy;
            HealthLabel.Text          = "100";
            ResetTimer();

            hunger = 0.5;
            energy = 0.5;
            mood   = 0.5;

            HungerBar.ProgressTo(hunger, 400, Easing.Linear);
            EnergyBar.ProgressTo(energy, 400, Easing.Linear);
            MoodBar.ProgressTo(mood, 400, Easing.Linear);

            updateUI();
        }
예제 #2
0
        void sleepFriendTapped(System.Object sender, System.EventArgs e)
        {
            friend.giveSleep();

            hunger -= 0.013;
            HungerBar.ProgressTo(hunger, 400, Easing.Linear);
            energy += 0.019;
            EnergyBar.ProgressTo(energy, 400, Easing.Linear);
            mood += 0.016;
            MoodBar.ProgressTo(mood, 400, Easing.Linear);
            if (health < 100)
            {
                health += 10;
            }
            HealthLabel.Text = health.ToString();

            ResetTimer();
            updateUI();
        }
예제 #3
0
        void partyFriendTapped(System.Object sender, System.EventArgs e)
        {
            friend.giveParty();

            hunger -= 0.013;
            HungerBar.ProgressTo(hunger, 400, Easing.Linear);
            energy -= 0.01;
            EnergyBar.ProgressTo(energy, 400, Easing.Linear);
            mood += 0.019;
            MoodBar.ProgressTo(mood, 400, Easing.Linear);
            if (health > 0)
            {
                health -= 2;
            }
            else if (health == 0)
            {
                DisplayAlert("Healt declined!", "Your friend is sick.", "Start over");
            }
            HealthLabel.Text = health.ToString();

            ResetTimer();
            updateUI();
        }