Esempio n. 1
0
 public void InputDraw()
 {
     _screen.Clear(Color.Gray);
     SplashKit.DrawRectangle(Color.Black, X, Y, Width, Height);
     SplashKit.FillRectangle(Color.LightGray, X + 1, Y + 1, Width - 2, Height - 2);
     SplashKit.DrawTextOnWindow(_screen, "Name: ", Color.Black, "Fira", 20, X + 10, Y + 10);
     SplashKit.FillRectangle(Color.White, X + 130, Y + 10, 400, 20);
     SplashKit.DrawTextOnWindow(_screen, "Assignments: ", Color.Black, "Fira", 20, X + 10, Y + 50);
     SplashKit.FillRectangle(Color.White, X + 130, Y + 50, 400, 20);
     SplashKit.FillRectangle(Color.DarkGray, X + 110, Y + 150, 80, 25);
     SplashKit.DrawTextOnWindow(_screen, "Next", Color.White, "Fira", 20, X + 130, Y + 150);
     if (_inp == 0)
     {
         SplashKit.DrawTextOnWindow(_screen, _name, Color.Black, "Fira", 19, X + 135, Y + 11);
         SplashKit.DrawTextOnWindow(_screen, Convert.ToString(_noOfAssignments), Color.Black, "Fira", 19, X + 135, Y + 51);
     }
     else if (_inp == 1)
     {
         SplashKit.DrawTextOnWindow(_screen, Convert.ToString(_noOfAssignments), Color.Black, "Fira", 19, X + 135, Y + 51);
     }
     else if (_inp == 2)
     {
         SplashKit.DrawTextOnWindow(_screen, _name, Color.Black, "Fira", 19, X + 135, Y + 11);
     }
 }
Esempio n. 2
0
    public void Show()
    {
        const int WIDTH = 200, HEIGHT = 100, GAP = 30;

        SplashKit.ProcessEvents();
        while (!SplashKit.KeyTyped(KeyCode.EscapeKey))
        {
            int i = 0, j = 0;
            SplashKit.ProcessEvents();
            _screen.Clear(Color.Gray);
            SplashKit.FillRectangle(Color.LightGray, X, Y, Width, Height);
            foreach (DashboardData assignment in _collection)
            {
                int x = X + WIDTH * j + GAP, y = Y + HEIGHT * i + GAP;
                SplashKit.DrawRectangle(Color.Black, x, y, WIDTH, HEIGHT);
                SplashKit.FillRectangle(GetUgrencyColor(assignment), x + 1, y + 1, WIDTH - 2, HEIGHT - 2);
                SplashKit.DrawTextOnWindow(_screen, assignment.unitName, Color.Black, "Fira", 25, x + 5, y + 5);
                SplashKit.DrawTextOnWindow(_screen, assignment.assignmentName, Color.Black, "Fira", 20, x + 5, y + 30);
                SplashKit.DrawTextOnWindow(_screen, assignment.dueDate.Day.ToString() + "-" + assignment.dueDate.Month.ToString() + "-" + assignment.dueDate.Year.ToString(), Color.Black, "Fira", 20, x + 5, y + 50);
                SplashKit.DrawTextOnWindow(_screen, assignment.dueDate.Subtract(DateTime.Today).Days.ToString() + " days left", Color.Black, "Fira", 20, x + 5, y + 75);

                if (++i > 3)
                {
                    j++;
                    i = 0;
                }
            }
            _screen.Refresh(60);
        }
    }
Esempio n. 3
0
        public void ProgressBar()
        {
            SplashKit.DrawRectangle(DefaultColor, -1, -1, SplashKit.ScreenWidth() + 2, 10);
            float percentage = (float)Timer.Ticks / (float)Duration.TotalMilliseconds;
            float progress   = percentage * SplashKit.ScreenWidth();

            SplashKit.FillRectangle(DefaultColor, -1, -1, (int)progress, 10);
        }
Esempio n. 4
0
 public override void DrawOutline()
 {
     SplashKit.DrawRectangle(
         clr: Color.Black,
         x: (X - 2),
         y: (Y - 2),
         width: (Width + 4),
         height: (Height + 4)
         );
 }
Esempio n. 5
0
 public override void Draw()
 {
     if (Bomb)
     {
         SplashKit.FillRectangle(Color, X, Y, Width, Height);
     }
     else
     {
         SplashKit.DrawRectangle(Color, X, Y, Width, Height);
     }
 }
Esempio n. 6
0
    public override void Draw()
    {
        _HealthPercent = (double)_Health / _MaxHealth;

        SplashKit.DrawBitmap(_Image, 800 - _Image.Width - _ImageBuffer, _ImageBuffer);
        SplashKit.FillRectangle(Color.DarkBlue, BoxOuterBuffer, BoxOuterBuffer, BoxWidth, BoxHeight);
        SplashKit.DrawRectangle(Color.White, BoxOuterBuffer, BoxOuterBuffer, BoxWidth, BoxHeight);
        SplashKit.DrawText($"{_Name} ", Color.White, MainFont, 40, BoxOuterBuffer + BoxInnerBuffer, BoxOuterBuffer + BoxInnerBuffer);
        SplashKit.DrawText($"Lv: {_Level} ", Color.White, MainFont, 40, BoxOuterBuffer + BoxWidth / 2 + 50, BoxInnerBuffer + BoxOuterBuffer);
        SplashKit.DrawText($"HP:", Color.White, MainFont, 40, BoxOuterBuffer + BoxInnerBuffer, BoxOuterBuffer + BoxInnerBuffer + 40);
        SplashKit.FillRectangle(Color.Red, BoxOuterBuffer + 2 * BoxInnerBuffer + 40, BoxOuterBuffer + 2 * BoxInnerBuffer + 40, _HealthPercent * HealthBarWidth, HealthBarHeight);
        SplashKit.DrawRectangle(Color.White, BoxOuterBuffer + 2 * BoxInnerBuffer + 40, BoxOuterBuffer + 2 * BoxInnerBuffer + 40, BoxWidth - 2 * BoxInnerBuffer - 2 * BoxOuterBuffer, HealthBarHeight);
    }
Esempio n. 7
0
    public override void Draw()
    {
        double leftX, rightX;
        double eyeY, mouthY;

        leftX  = X + 12;
        rightX = X + 27;
        eyeY   = Y + 10;
        mouthY = Y + 30;
        SplashKit.FillRectangle(Color.Gray, X, Y, 50, 50);
        SplashKit.DrawRectangle(MainColor, leftX, eyeY, 10, 10);
        SplashKit.DrawRectangle(MainColor, rightX, eyeY, 10, 10);
        SplashKit.DrawRectangle(MainColor, leftX, mouthY, 25, 10);
        SplashKit.DrawRectangle(MainColor, leftX + 2, mouthY + 2, 21, 6);
    }
Esempio n. 8
0
    public override void Draw()
    {
        SplashKit.DrawBitmap(_Image, X, Y);

        SplashKit.FillRectangle(Color.DarkBlue, BoxX, BoxY, BoxWidth, BoxHeight);
        SplashKit.DrawRectangle(Color.White, BoxX, BoxY, BoxWidth, BoxHeight);

        _HealthPercent = (double)_Health / _MaxHealth;



        SplashKit.DrawText($"{_Name} ", Color.White, MainFont, 40, _GameWindow.Width - BoxWidth - BoxOuterBuffer + BoxInnerBuffer, 3 * _GameWindow.Height / 4 - BoxHeight - BoxOuterBuffer + BoxInnerBuffer);
        SplashKit.DrawText($"HP:", Color.White, MainFont, 40, _GameWindow.Width - BoxWidth - BoxOuterBuffer + BoxInnerBuffer, 3 * _GameWindow.Height / 4 - BoxHeight - BoxOuterBuffer + BoxInnerBuffer + 40);
        SplashKit.DrawText($"Lv: {_Level}", Color.White, MainFont, 40, _GameWindow.Width - BoxOuterBuffer - BoxWidth / 2 + 50, 3 * _GameWindow.Height / 4 - BoxOuterBuffer - BoxHeight + BoxInnerBuffer);
        SplashKit.FillRectangle(Color.Red, _GameWindow.Width - BoxWidth - BoxOuterBuffer + 2 * BoxInnerBuffer + 40, 3 * _GameWindow.Height / 4 - BoxHeight - BoxOuterBuffer + 2 * BoxInnerBuffer + 40, _HealthPercent * HealthBarWidth, HealthBarHeight);
        SplashKit.DrawRectangle(Color.White, _GameWindow.Width - BoxWidth - BoxOuterBuffer + 2 * BoxInnerBuffer + 40, 3 * _GameWindow.Height / 4 - BoxHeight - BoxOuterBuffer + 2 * BoxInnerBuffer + 40, HealthBarWidth, HealthBarHeight);
    }
Esempio n. 9
0
    public void DrawInstructions()
    {
        SplashKit.FillRectangle(Color.DarkBlue, _InstructionsX, _InstructionsY, 3 * gameWindow.Width / 4, 3 * gameWindow.Height / 4);
        SplashKit.DrawRectangle(Color.White, _InstructionsX, _InstructionsY, 3 * gameWindow.Width / 4, 3 * gameWindow.Height / 4);
        SplashKit.DrawText($"Welcome to C# Battler", Color.White, _MainFont, 40, _InstructionsX + 20, _InstructionsY);

        SplashKit.DrawText($"Use the menu to navigate", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 2 * _LineHeight);

        SplashKit.DrawText($"The Charge Attack is a mostly accurate but low damage attack", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 4 * _LineHeight);
        SplashKit.DrawText($"The Slash Attack is a semi accurate and high damage attack", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 5 * _LineHeight);
        SplashKit.DrawText($"The Spell Attack is a semi accurate low attack that ignores counters", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 6 * _LineHeight);

        SplashKit.DrawText("A counter is 50% likely to reflect back an attack for half damage", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 8 * _LineHeight);

        SplashKit.DrawText($"You begin with 10 potions which each heal 30 Health", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 10 * _LineHeight);
        SplashKit.DrawText($"A magic heal will heal a random amount relative to your level", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 11 * _LineHeight);
        SplashKit.DrawText("The button labelled Instructions in the top left will toggle this box", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 13 * _LineHeight);
        SplashKit.DrawText("Enjoy!", Color.White, _MainFont, 22, _InstructionsX + 20, _InstructionsY + 14 * _LineHeight);
    }
Esempio n. 10
0
    public override void Draw()
    {
        double leftX, midX, rightX;
        double midY, eyeY, mouthY;

        leftX  = X + 17;
        midX   = X + 25;
        rightX = X + 33;

        midY   = Y + 25;
        eyeY   = Y + 20;
        mouthY = Y + 35;

        SplashKit.DrawRectangle(MainColor, X, Y, 50, 50);
        SplashKit.DrawRectangle(Color.SeaGreen, X + 3, Y + 3, 45, 45);
        SplashKit.FillCircle(MainColor, leftX, eyeY, 5);
        SplashKit.FillCircle(MainColor, rightX, eyeY, 5);
        SplashKit.FillEllipse(Color.Peru, X + 10, eyeY + 5, 33, 22);
        SplashKit.FillEllipse(Color.Ivory, X + 14, eyeY + 11, 24, 16);
    }
Esempio n. 11
0
    public void Draw()
    {
        if (Type == BlockType.Filled)
        {
            SplashKit.FillRectangle(_Colour, X * _Size, Y * _Size, _Size, _Size);
            SplashKit.DrawRectangle(Color.Black, X * _Size, Y * _Size, _Size, _Size);
        }

        if (Type == BlockType.Ghost)
        {
            SplashKit.DrawRectangle(_Colour, X * _Size, Y * _Size, _Size, _Size);
        }

        if (Type == BlockType.Wall)
        {
            SplashKit.FillRectangle(Color.DarkSlateBlue, X * _Size, Y * _Size, _Size, _Size);
            SplashKit.DrawRectangle(Color.Black, X * _Size, Y * _Size, _Size, _Size);
        }
        if (Type == BlockType.Empty)
        {
            SplashKit.DrawRectangle(Color.Black, X * _Size, Y * _Size, _Size, _Size);
        }
    }
Esempio n. 12
0
 public override void Draw() => SplashKit.DrawRectangle(BorderColor, X, Y, Width, Height);
Esempio n. 13
0
 public void Draw()
 {
     SplashKit.FillRectangle(Color.DarkBlue, X, Y, Width, Height);
     SplashKit.DrawRectangle(Color.White, X, Y, Width, Height);
     SplashKit.DrawText(Caption, Color.White, _MainFont, 30, X + 5, Y + 5);
 }
Esempio n. 14
0
 public void DrawDefeatedBox()
 {
     SplashKit.FillRectangle(Color.DarkBlue, 0, 3 * gameWindow.Height / 4 - 40, 400, 40);
     SplashKit.DrawRectangle(Color.White, 0, 3 * gameWindow.Height / 4 - 40, 400, 40);
     SplashKit.DrawText($"Enemies Defeated: {_Player.EnemiesDefeated}", Color.White, _MainFont, 40, 40, 3 * gameWindow.Height / 4 - 40);
 }
Esempio n. 15
0
        public void Display()
        {
            SplashKit.ProcessEvents();
            SplashKit.ClearScreen();
            SplashKit.DrawBitmap("Background", 0, 0);
            string rank;
            float  percentage = (float)Game.getInstance().Hits / (float)Game.getInstance().TotalHits;

            Game.getInstance().DisplayText.Clear();
            if (!startup)
            {
                Game.getInstance().Buttons.Clear();
                Game.getInstance().ButtonColor.Clear();
                Game.getInstance().ButtonColor.AddRange(Enumerable.Repeat(Game.getInstance().DefaultColor, 3));
                startup = true;
            }
            SplashKit.DrawRectangle(Game.getInstance().DefaultColor, 195, 150, 450, 95);
            Game.getInstance().DisplayText.Add(new Text("Level Complete", Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 40, 225, 90));
            Game.getInstance().DisplayText.Add(new Text($"Score: {Game.getInstance().Score}", Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 15, 200, 160));
            Game.getInstance().DisplayText.Add(new Text($"Highest Combo: {Game.getInstance().Combo}", Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 15, 200, 180));
            Game.getInstance().DisplayText.Add(new Text($"Bombs Hit: {Game.getInstance().LivesUsed}", Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 15, 200, 200));
            Game.getInstance().DisplayText.Add(new Text($"Hits: {Game.getInstance().Hits} / {Game.getInstance().TotalHits}", Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 15, 200, 220));
            if (percentage == 1)
            {
                rank = "S+";
            }
            else if (percentage >= 0.9)
            {
                rank = "S";
            }
            else if (percentage >= 0.8)
            {
                rank = "A";
            }
            else if (percentage >= 0.7)
            {
                rank = "B";
            }
            else if (percentage >= 0.5)
            {
                rank = "C";
            }
            else if (percentage >= 0.2)
            {
                rank = "D";
            }
            else
            {
                rank = "F";
            }
            Game.getInstance().DisplayText.Add(new Text("Rank", Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 15, 580, 170));
            Game.getInstance().DisplayText.Add(new Text(rank, Game.getInstance().DefaultColor, Game.getInstance().DefaultFont, 35, 592, 190));
            Game.getInstance().DisplayText.Add(new Text("Retry", Game.getInstance().ButtonColor[0], Game.getInstance().DefaultFont, 35, 245, 270));
            Game.getInstance().DisplayText.Add(new Text("Exit", Game.getInstance().ButtonColor[1], Game.getInstance().DefaultFont, 35, 450, 270));
            int index = Game.getInstance().Buttons.FindIndex(f => f.Width == 160);

            if (index == -1)
            {
                Game.getInstance().Buttons.Add(new Button(Game.getInstance().DefaultColor, 230, 265, 160, 50));
                Game.getInstance().Buttons.Add(new Button(Game.getInstance().DefaultColor, 415, 265, 160, 50));
            }
            foreach (GameObject o in Game.getInstance().Objects)
            {
                o.Draw();
            }
            foreach (HP o in Game.getInstance().HP)
            {
                o.Draw();
            }
            foreach (Button o in Game.getInstance().Buttons)
            {
                o.Draw();
            }
            Game.getInstance().Player.Draw();
        }