Ejemplo n.º 1
0
        public GameStateMars(ContentManager c, Game1 g)
        {
            Game = g;
            Content = c;

            rockMap = new RockMap(Content);

            windowRect = new Rectangle(0, 0, 1500, int.MaxValue);

            inputHandler = new InputHandler();

            drillSound = Content.Load<SoundEffect>("Drill");
            thrustSound = Content.Load<SoundEffect>("Thrust");
            drillSoundInstance = Content.Load<SoundEffect>("Drill").CreateInstance();
            drillSoundInstance.IsLooped = true;
            thrustSoundInstance = Content.Load<SoundEffect>("Thrust").CreateInstance();
            thrustSoundInstance.IsLooped = true;
            boomSound = Content.Load<SoundEffect>("Boom");

            sdSystem = new TextSystem("profont.png", Content);
            sdSystem.resetString(new Vector2(5, 725));
            sdSystem.addString("Out of energy. Press \\3ESC to self-destruct");

            bg = new Sprite("mars-bg.png", Content, new Vector2(0, 0), false);
            player = new Player("miner.png", Content, new Vector2(windowRect.Width/2, 25));
            shop = new Sprite("shop.png", Content, new Vector2(500, 25));
            deadOverlay = new Sprite("dead.png", Content, new Vector2(0, 0), false);

            otherPlayers = new Dictionary<string, Player>();

            mapOffset = new Vector2(0,-125);

            thrusters = false;
            transY = 0f;
            transX = 0f;

            drillTime = 0f;

            redTexture = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            redTexture.SetData(new Color[] { Color.Red });
            blueTexture = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            blueTexture.SetData(new Color[] { Color.Blue });
            greenTexture = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            greenTexture.SetData(new Color[] { Color.Green });
            blackTexture = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            blackTexture.SetData(new Color[] { Color.Black });
        }
Ejemplo n.º 2
0
 public TextWindow(string[] dialog, ContentManager Content, Vector2 pos, Vector2 siz, double tpc = 25, double bgA = 0.5)
 {
     lines = dialog;
     position = pos;
     size = siz;
     currentLine = 0;
     currentCharacter = 0;
     totalTime = 0.0;
     timePerChar = tpc;
     bgAlpha = bgA;
     waitingForContinue = false;
     blackTexture = new Texture2D (Game1.graphics.GraphicsDevice, 1, 1);
     Color[] blackData = new Color[1];
     blackData [0] = Color.Black;
     blackTexture.SetData (blackData);
     textSystem = new TextSystem ("test-semifont.png", Content);
     textSystem.resetString(new Vector2 (position.X+5,position.Y+5));
     done = false;
 }