Exemplo n.º 1
0
        private void DrawText(int x, SimFrame ret)
        {
            Brush colour = new SolidBrush(Color.Orange);
            Brush shadow = new SolidBrush(Color.Green);

            //ADD STRINGS
            ret.AddTextWithShadow("title", "---SpaceShip---", new Vec2(x, 30), colour, shadow);
            ret.AddTextWithShadow("ySpeed", "Speed Y:  " + SpaceShip.YVel.ToString("F"), new Vec2(x, 50), colour, shadow);
            ret.AddTextWithShadow("xSpeed", "Speed X:  " + SpaceShip.XVel.ToString("F"), new Vec2(x, 70), colour, shadow);
            ret.AddTextWithShadow("height", "Height:   " + SpaceShip.Y.ToString("F"), new Vec2(x, 90), colour, shadow);
            ret.AddTextWithShadow("xPos", "X-Pos:   " + SpaceShip.X.ToString("F"), new Vec2(x, 110), colour, shadow);
            ret.AddTextWithShadow("throttle", "Throttle: " + SpaceShip.Throttle.ToString("F"), new Vec2(x, 130), colour, shadow);
            ret.AddTextWithShadow("Fuel", "Fuel:     " + SpaceShip.Fuel.ToString("F"), new Vec2(x, 150), colour, shadow);
        }
Exemplo n.º 2
0
        private bool CheckForFinishText(SimFrame ret)
        {
            if (SpaceShip.Landed)
            {
                if (SpaceShip.Boom)
                {

                    ret.AddTextWithShadow("Failure", "FAIL", new Vec2(150, 150), 100, new SolidBrush(Color.Red),
                                          new SolidBrush(Color.White));
                    ret.ChangeImage("ss", SpriteList.SpaceShip_Explode);
                }
                else
                {
                    ret.AddTextWithShadow("Success", "SAFE", new Vec2(150, 150), 100, new SolidBrush(Color.Green),
                                          new SolidBrush(Color.White));
                    ret.ChangeImage("ss", SpriteList.SpaceShip_Landed);
                }
                return true;
            }
            return false;
        }
Exemplo n.º 3
0
        private void DrawDebug(SimFrame ret, Vec2 leftT, Vec2 downT, Vec2 rightT)
        {
            Brush colour = new SolidBrush(Color.Red);
            Brush shadow = new SolidBrush(Color.White);

          
            ret.AddTextWithShadow("debug_left", String.Format("{0}", SpaceShip.Left.ToString("F")), leftT, 10, colour, shadow);
            ret.AddTextWithShadow("debug_down", String.Format("{0}", SpaceShip.Throttle.ToString("F")), downT, 10, colour, shadow);
            ret.AddTextWithShadow("debug_right", String.Format("{0}", SpaceShip.Right.ToString("F")), rightT, 10, colour, shadow);
           
        }
Exemplo n.º 4
0
        private void DrawText(int x, ref  SimFrame ret)
        {
            Brush colour = new SolidBrush(Color.Black);
            Brush shadow = new SolidBrush(Color.White);

            ret.AddTextWithShadow("location", String.Format("X, Y: \t\t\t {0}, {1}", Harrier.X.ToString("F"), Harrier.Y.ToString("F")), new Vec2(x, 20), colour, shadow);
            ret.AddTextWithShadow("velocity", String.Format("X-Vel, Y-Vel: \t\t {0}, {1}", Harrier.XVel.ToString("F"), Harrier.YVel.ToString("F")), new Vec2(x, 40), colour, shadow);
            ret.AddTextWithShadow("consumption", String.Format("Secs, Fuel: \t\t {0}, {1}", ((double)Globals.TurnCount / Harrier.TickPerSecond).ToString("F"), Harrier.Fuel.ToString("F")), new Vec2(x, 60), colour, shadow);
            ret.AddTextWithShadow("physics", String.Format("Mass, Throttle: \t\t {0}, {1}", Harrier.Mass.ToString("F"), Harrier.Throttle.ToString("F")), new Vec2(x, 80), colour, shadow);
            ret.AddTextWithShadow("wind", String.Format("ThrustVec, WindGust: \t {0}, {1}", Harrier.ThrustVector.ToString("F"), Harrier.WindSpeed.ToString("F")), new Vec2(x, 100), colour, shadow);
            ret.AddTextWithShadow("relative", String.Format("Speed Relative to Ship: \t {0}", Harrier.RelativeXVel.ToString("F")), new Vec2(x, 120), colour, shadow);
            ret.AddTextWithShadow("shipsSpeed", String.Format("Ship Speed knots (mps): \t {0}, {1}", Harrier.shipSpeed.ToString("F"), (Harrier.shipSpeed*Harrier.ConvertKnotsToMps).ToString("F")), new Vec2(x, 140), colour, shadow);
            ret.AddTextWithShadow("safeX", String.Format("Safe X: \t\t\t {0}", (Harrier.X - Harrier.MidSafeX - 40).ToString("F")), new Vec2(x, 160), colour, shadow);
        }
Exemplo n.º 5
0
        private void DrawDebug(SimFrame ret)
        {
            Brush colour = new SolidBrush(Color.Red);
            Brush shadow = new SolidBrush(Color.White);

            double xx = 0, yy = 0;
            Move2DInDirHS(Harrier.X, Harrier.Y, DegToRad(270 - Harrier.ThrustVector), Harrier.Throttle / 4, ref xx, ref yy);

            ret.AddTextWithShadow("debug_TV", String.Format("{0}", Harrier.ThrustVector.ToString("F")), new Vec2(ToX(Harrier.X+1), ToY(Harrier.Y-5)), 10, colour, shadow);
            ret.AddTextWithShadow("debug_Thrust", String.Format("{0}", Harrier.Throttle.ToString("F")), new Vec2(ToX(xx+2), ToY(yy)), 10, colour, shadow);
        }
Exemplo n.º 6
0
        private void CheckForFinishText(SimFrame ret)
        {
            if(Harrier.Landed)
                if (Harrier.Boom)
                {

                    ret.AddTextWithShadow("Failure", "FAIL", new Vec2(150, 150), 100 , new SolidBrush(Color.Red), new SolidBrush(Color.DimGray));
                }
                else
                {
                    ret.AddTextWithShadow("Success", "SAFE", new Vec2(150, 150), 100, new SolidBrush(Color.Green), new SolidBrush(Color.DimGray));
                }
        }