예제 #1
0
        /// <summary> //VESTIGIAL PROTOTYPE...
        /// Draws the next turn based off the previous frame
        /// Avoids all the 'new'ing that takes place in the other DrawTurn
        /// </summary>
        /// <param name="frame"></param>
        /// <returns></returns>
        public override SimFrame DrawTurn(SimFrame frame)
        {
            frame.Find("ss").Position = new Vec2(SpaceShip.X,
                                           (FrameResolution.Y -
                                            (SpaceShip.Y / (SimVars.MoonLanderVars.SIM_HEIGHT / FrameResolution.Y))) - 60);

            frame.Find("downThrust").Position = new Vec2(SpaceShip.X + 4,
                                      (FrameResolution.Y -
                                       (SpaceShip.Y / (SimVars.MoonLanderVars.SIM_HEIGHT / FrameResolution.Y))) - 20);


            frame.Find("leftThrust").Position = new Vec2(SpaceShip.X - 10 - (32 * SpaceShip.Left / 3),
                                     (FrameResolution.Y -
                                      (SpaceShip.Y / (SimVars.MoonLanderVars.SIM_HEIGHT / FrameResolution.Y))) - 50);

            frame.Find("rightThrust").Position = new Vec2(SpaceShip.X + 42,
                                     (FrameResolution.Y -
                                      (SpaceShip.Y / (SimVars.MoonLanderVars.SIM_HEIGHT / FrameResolution.Y))) - 50);



            ((Sprite)frame.Find("downThrust")).Scale = new Vec2(1, SpaceShip.Throttle * .04);
            ((Sprite)frame.Find("leftThrust")).Scale = new Vec2(SpaceShip.Left / 3, .5);
            ((Sprite)frame.Find("rightThrust")).Scale = new Vec2(SpaceShip.Right / 3, .5);
                


            if (SpaceShip.Landed)
            {
                if (SpaceShip.Boom)
                {
                    frame.AddText("FAIL", new Vec2(250, 150), new SolidBrush(Color.Red), 100);
                    frame.ChangeImage("ss", SpriteList.SpaceShip_Explode);
                    Fail();
                }
                else
                {
                    frame.AddText("SAFE", new Vec2(250, 150), new SolidBrush(Color.Green), 100);
                    frame.ChangeImage("ss", SpriteList.SpaceShip_Landed);
                }
            }

            frame.ChangeText("ySpeed", "Speed Y:  " + SpaceShip.YVel.ToString("F"));
            frame.ChangeText("xSpeed", "Speed X:  " + SpaceShip.XVel.ToString("F"));
            frame.ChangeText("height", "Height:   " + SpaceShip.Y.ToString("F"));
            frame.ChangeText("xPos", "X-Pos:   " + SpaceShip.X.ToString("F"));
            frame.ChangeText("throttle", "Throttle: " + SpaceShip.Throttle.ToString("F"));
            frame.ChangeText("Fuel", "Fuel:     " + SpaceShip.Fuel.ToString("F"));

            return frame;

        }
예제 #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;
        }