Esempio n. 1
0
        // Update uppdaterar trianglens rotation och placering på planet
        // samt tillkallar Alive() metoden för att titta om spelaren lever
        private void Update()
        {
            Alive();

            CheckKeyInput();

            color = ButtonSeries.GetSelectedColor(3);

            for (int i = 0; i < 3; i++)
            {
                pointTriangle[i].X = (xPlanePos);
                pointTriangle[i].Y = (yPlanePos);

                if (i > 0)
                {
                    pointTriangle[i].X += (spaceshipSize * ToFloat(xCircle[i - 1]));
                    pointTriangle[i].Y += (spaceshipSize * ToFloat(yCircle[i - 1]));
                }

                if (i < 2)
                {
                    pointLine[i].X = (xPlanePos);
                    pointLine[i].Y = (yPlanePos);
                }
                if (i == 1)
                {
                    pointLine[i].X += (spaceshipSize * ToFloat(xLine[i]));
                    pointLine[i].Y += (spaceshipSize * ToFloat(yLine[i]));
                }
            }
        }
Esempio n. 2
0
        public void DrawUI()
        {
            Raylib.DrawText("SCORE:", 30, 28, 35, ButtonSeries.GetSelectedColor(3));
            Raylib.DrawText(Spaceship.GetSpaceshipScore(1).ToString(), 180, 28, 35, ButtonSeries.GetSelectedColor(3));
            Raylib.DrawText("PAUSE [P]", 800, 28, 35, ButtonSeries.GetSelectedColor(3));

            UserInterfaceKey.DrawAll();
        }
Esempio n. 3
0
        // metod som uppdaterar skottets position
        private void Update()
        {
            color = ButtonSeries.GetSelectedColor(3);

            lazerSpeed -= 15;

            x = ((Math.Cos(v) * lazerSpeed) + OriginX);
            y = ((Math.Sin(v) * lazerSpeed) + OriginY);

            rect.x = ToFloat(x);
            rect.y = ToFloat(y);
        }
Esempio n. 4
0
        private void Update()
        {
            rectangleColorInt = ButtonSeries.GetSelectedColor(colorInt);

            if (ButtonSeries.GetSelectedButtonID(3) == 0)
            {
                textColor = Color.BLACK;
            }

            if (Raylib.IsKeyDown(key))
            {
                highlightKey = true;
            }
            else
            {
                highlightKey = false;
            }
        }
Esempio n. 5
0
 public new void Draw()
 {
     Raylib.DrawRectangleGradientV(300, 300, 400, 400, ButtonSeries.GetSelectedColor(3), new Color(0, 0, 0, 0));
     Button.DrawAll(6);
     Raylib.DrawText("Pause", 410, 330, 60, Color.BLACK);
 }