Beispiel #1
0
        public HudHealth(Hud hud, SpriteFont font, Game1 game)
            : base(hud, font, game)
        {
            healthPos = new Vector2(659, 45);
            shieldBarPos = new Vector2(960, 75);
            hpBarPos = new Vector2(960, 115);
            hpSys = game.ship.shipHealth;
            wakeThresh = 3;

            targ1 = new RenderTarget2D(game.GraphicsDevice, 603, 104);
            targ2 = new RenderTarget2D(game.GraphicsDevice, 603, 104);
            targ3 = new RenderTarget2D(game.GraphicsDevice, 603, 104);
            sb = new SpriteBatch(game.GraphicsDevice);

            solidWhite = new Texture2D(game.GraphicsDevice, 1, 1);
            solidWhite.SetData(new Color[] { Color.White });

            hudHealthF = game.Content.Load<Texture2D>(@"Hud/hudHealthF");
            hudHealthB = game.Content.Load<Texture2D>(@"Hud/hudHealthB");
            shieldMask = game.Content.Load<Texture2D>(@"Hud/Masks/hudHealthM1");
            hpMask = game.Content.Load<Texture2D>(@"Hud/Masks/hudHealthM2");
            alphaMap = TextureManager.alphaMap;
        }
Beispiel #2
0
        public Ship(Game1 game)
            : base(game)
        {
            this.game = game;

            lastNodePos = Vector2.Zero;
            pos = new Vector3(90, 4.5f, 0);
            moveSpeed = 0;
            accel = 0.5f;
            maxSpeed = 0.2f;
            boostSpeed = 0.6f;
            direction = new Vector3(0, 0, -1);
            currentTurnSpeed = 0;
            maxTurnSpeed = MathHelper.PiOver4 / 30;

            boundingBox = new OOBB(pos, direction, 1.5f, 1.5f); // Need to be changed to be actual ship dimentions
            circleCol = new CircleCollider(pos, 0.75f);

            shipModel = new ShipModel(this, game);
            //shipModel = new ShipModel(game.Content.Load<Model>(@"Models/Enemies/Cubes/guncube"), this);
            skyboxModel = new SkyboxModel(game.Content.Load<Model>(@"Models/Misc/Skybox/skybox"), this);
            speedCyl = new SpeedCylModel(game.Content.Load<Model>(@"Models/Misc/speedCyl"), this, ((Game1)Game));
            rbowTun = new RainbowTunnelModel(game.Content.Load<Model>(@"Models/Misc/Rbow/rbowTun"), this, ((Game1)Game));

            game.modelManager.addObject(shipModel);
            game.modelManager.add(skyboxModel);
            game.modelManager.addObject(rbowTun);
            game.modelManager.addTransparent(speedCyl);

            weapons = new WeaponSystem(this, this.game);
            moneyManager = new MoneyManager(this.game);
            particles = new ShipParticleSystem(this.game, this);
            shipHealth = new ShipHealthSystem(this.game, this);

            game.Components.Add(weapons);
            game.Components.Add(moneyManager);
            game.Components.Add(particles);
            game.Components.Add(shipHealth);

            ((WeaponDrill)weapons.weapons.ElementAt(4)).dome.setShip(this);
            alive = true;
        }