Esempio n. 1
0
        public new void Render()
        {
            base.Render();
            statHeart.Render(830, 20, RED);
            statSoul.Render(830, 60, ORANGE);

            cityStatHealth.Render(45, 640, GREEN);
            cityStatPopPercent.Render(50, 675, GOLD);
            cityStatCrimeRate.Render(64, 710, RED);
            cityStatUnemployment.Render(330, 632, BROWN);
            cityStatHappiness.Render(335, 665, PURPLE);

            // 839, 640
            DrawText(StaticPlayer.TimeHour + ":" + Util.PadZeroes(StaticPlayer.TimeMinute, 2), 839, 640, 72, BLACK);
            // 832, 720
            DrawText("you have survived for " + StaticPlayer.Days + " days.", 832, 720, 12, DARKGRAY);
        }
Esempio n. 2
0
        public void Update()
        {
            time++;
            if (time < 600)
            {
                DrawTexture(gameBackgrounds[index], 0, 0, WHITE);

                DrawTexture(instructionsBackground, 0, 0, WHITE);

                enoughTapsBar.SetValue(amount);
                timerBar.SetValue(time);
                enoughTapsBar.Render(10, 180, RED);
                timerBar.Render(10, 740, WHITE);

                int offset = 0;
                foreach (char c in games[index])
                {
                    if (!candidateSelected[index])
                    {
                        if (GetRandomValue(1, 10) < 9)
                        {
                            DrawText(c.ToString(), 10 + offset, 10, 65, BLACK);
                        }
                        else
                        {
                            candidates[index]        = c.ToString();
                            candidateSelected[index] = true;
                            DrawText(c.ToString(), 10 + offset, 10, 65, GREEN);
                        }
                    }
                    else
                    {
                        if (c.ToString() == candidates[index])
                        {
                            DrawText(c.ToString(), 10 + offset, 10, 65, GREEN);
                        }
                        else
                        {
                            DrawText(c.ToString(), 10 + offset, 10, 65, BLACK);
                        }
                    }
                    offset += 2 + MeasureText(c.ToString(), 65);
                }

                if (candidateSelected[index])
                {
                    if (IsKeyReleased(keyMapping[candidates[index]]))
                    {
                        PlaySound(Sounds.HIT);
                        amount += 40;
                        if (amount >= barMax)
                        {
                            StaticPlayer.Heart += heartEffect[index];
                            StaticPlayer.Soul  += soulEffect[index];

                            if (StaticPlayer.Heart > 100)
                            {
                                StaticPlayer.Heart = 100;
                            }
                            if (StaticPlayer.Soul > 100)
                            {
                                StaticPlayer.Soul = 100;
                            }

                            amount = 0;
                            index++;
                            if (index == gameBackgrounds.Length)
                            {
                                PlaySound(Sounds.TITLE);
                                index             = 0;
                                barMax           += 100;
                                enoughTapsBar     = new UIBar(390, barMax);
                                candidates        = new string[games.Length];
                                candidateSelected = new bool[games.Length];
                            }
                        }
                    }
                }
                amount--;
                if (amount < 0)
                {
                    amount = 0;
                }
            }
            else
            {
                StopSound(Sounds.MUSIC_SELFCARE);
                PlaySound(Sounds.AMBIENT_CITYHUM);
                MainClass.stateManager.SwitchStateNoInit(MainClass.stateCity);
            }
        }