Beispiel #1
0
        public override void Draw(GameTime gameTime)
        {
            if (!GlobalValues.GoToMainMenu)
            {
                if (GlobalValues.LevelLoaded == "Random")
                {
                    Terrain.BuildTerrain(mapShiftPosition);
                    Terrain.BuildPads(mapShiftPosition);
                }
                else
                {
                    Terrain.BuildTerrain(Vector2.Zero);
                    Terrain.BuildPads(Vector2.Zero);
                }

                pb.Begin(PrimitiveType.LineList);

                ShowGUIWords();
                ShowGUINumbers();
                ShowControls();
                ShowTitle();

                pb.End();

                lander.Draw(gameTime);
            }
        }
Beispiel #2
0
 public override void Draw(GameTime gameTime)
 {
     StateManager.graphicsDevice.Clear(bgColor);
     lander.Draw(gameTime);
     terrain.Draw(gameTime);
     if (lander.State == Lander.landerState.playing)
     {
         float   newFontScale = fontScale * 2.0f / 3.0f;
         Vector2 fontLocation = new Vector2(3, 3);
         VectorFont.DrawString(string.Format("Fuel {0:000.0}", lander.Fuel), fontScale, fontLocation, Color.CornflowerBlue);
         fontLocation.Y += (3 * fontScale);
         VectorFont.DrawString(string.Format("XSpeed {0:00.0}", lander.XSpeed), fontScale, fontLocation, Color.Coral);
         fontLocation.Y += (3 * fontScale);
         VectorFont.DrawString(string.Format("YSpeed {0:00.0}", lander.YSpeed), fontScale, fontLocation, Color.Coral);
         fontLocation.Y += (3 * fontScale);
         VectorFont.DrawString(string.Format("Angle {0:000}", lander.Angle), fontScale, fontLocation, Color.Coral);
         fontLocation.X = (StateManager.graphicsDevice.Viewport.Width / 10) * 7;
         fontLocation.Y = 3;
         VectorFont.DrawString("Esc to quit", newFontScale, fontLocation, Color.Coral);
         fontLocation.Y += 3 * newFontScale;
         VectorFont.DrawString("Space to thrust", newFontScale, fontLocation, Color.Coral);
         fontLocation.Y += 3 * newFontScale;
         VectorFont.DrawString("Right to rotate CW", newFontScale, fontLocation, Color.Coral);
         fontLocation.Y += 3 * newFontScale;
         VectorFont.DrawString("Left to rotate CCW", newFontScale, fontLocation, Color.Coral);
     }
     else if (lander.State == Lander.landerState.crashed)
     {
         Vector2 fontPlace = new Vector2(StateManager.graphicsDevice.Viewport.Width / 5 * 2, 4 * fontScale);
         VectorFont.DrawString("You Crashed", fontScale, fontPlace, Color.White);
         fontPlace.Y += 3 * fontScale;
         fontPlace.X  = StateManager.graphicsDevice.Viewport.Width / 5;
         VectorFont.DrawString("You get no more points and are dead", fontScale, fontPlace, Color.White);
         fontPlace.Y += 3 * fontScale;
         VectorFont.DrawString(string.Format("You had {0:000000} points", StateManager.Score), fontScale, fontPlace, Color.White);
         fontPlace.Y += 3 * fontScale;
         VectorFont.DrawString("Press ESC to go back to menu", fontScale, fontPlace, Color.White);
     }
     else
     {
         Vector2 fontPlace = new Vector2(StateManager.graphicsDevice.Viewport.Width / 5 * 2, 4 * fontScale);
         VectorFont.DrawString("You Landed", fontScale, fontPlace, Color.Black);
         fontPlace.Y += 3 * fontScale;
         fontPlace.X  = StateManager.graphicsDevice.Viewport.Width / 5;
         VectorFont.DrawString(string.Format("You get {0:0000} points", (lander.Fuel * 100)), fontScale, fontPlace, Color.Black);
         fontPlace.Y += 3 * fontScale;
         VectorFont.DrawString(string.Format("You have {0:0000} points", StateManager.Score), fontScale, fontPlace, Color.Black);
         fontPlace.Y += 3 * fontScale;
         fontPlace.X  = StateManager.graphicsDevice.Viewport.Width / 10;
         VectorFont.DrawString("Press Enter to go to next landing site", fontScale, fontPlace, Color.Black);
         fontPlace.Y += 3 * fontScale;
         fontPlace.X  = StateManager.graphicsDevice.Viewport.Width / 5;
         VectorFont.DrawString("Press ESC to go back to menu", fontScale, fontPlace, Color.Black);
     }
 }
        public override void Draw(GameTime gameTime)
        {
            pb.Begin(PrimitiveType.LineList);

            foreach (Vector2 x in terrain.terrainList)
            {
                pb.AddVertex(x, Color.White);
            }

            foreach (Vector2 x in terrain.padsList)
            {
                pb.AddVertex(x, Color.Green);
            }

            foreach (Vector2 x in fuelWord.sentence)
            {
                pb.AddVertex(x + new Vector2(10, 10), Color.White);
            }

            if (terInt || padsInt)
            {
                if (terInt)
                {
                    StateManager.graphicsDevice.Clear(Color.DarkRed);
                }

                if (padsInt)
                {
                    StateManager.graphicsDevice.Clear(Color.DarkGreen);
                }
            }

            lander.Draw(gameTime);

            pb.End();

            spriteBatch.Begin();

            AllTheWords();

            spriteBatch.End();
        }