Example #1
0
 public PlanetSurfaceView(EmpireGame game, PlanetSurface surface)
 {
     Game      = game;
     Surface   = surface;
     FocusTile = surface.TileGrid[0, 0];
     Camera    = new PlanetSurfaceCamera(this);
     Font      = game.Content.Load <SpriteFont>("Graphics/DefaultFont12");
 }
Example #2
0
 public Tile(PlanetSurface surface, int x, int y, int altitude, Biome biome, Random rng)
 {
     Surface  = surface;
     X        = x;
     Y        = y;
     Altitude = altitude;
     SetBiome(biome, rng);
     DrawDepth = DrawDepthMin + DrawDepthRange * (float)rng.NextDouble();
 }
Example #3
0
        public void OnKeyboardAction(KeyboardEventArgs keyboard)
        {
            if (keyboard.Action == KeyboardAction.Released)
            {
                switch (keyboard.Key)
                {
                case Keys.G:
                    ShouldDrawGrid = !ShouldDrawGrid; break;

                case Keys.I:
                    ShouldDrawInfo = !ShouldDrawInfo; break;

                case Keys.R:
                    int width = Game.RNG.Next(10, 100);
                    Surface = new PlanetSurface(width * 2, width, Game.Data, Game.RNG);
                    Camera.MoveTo(Point.Zero);
                    break;

                case Keys.Space:
                    Surface.Update(Game.RNG);
                    break;
                }
            }
        }