Esempio n. 1
0
        public BasicEnemy(Texture2D texture)
        {
            originVector = new Vector2(texture.Width / 2, texture.Height / 2);

            randomSpawn();

            boundRect = new Rectangle((int)position.X - (int)originVector.X, (int)position.Y - (int)originVector.Y, texture.Width, texture.Height);
            fireCounter = 0f;

            se = new World.Effects.ShieldEffect();
        }
Esempio n. 2
0
        public Player(Texture2D sp)
        {
            position = new Vector2(0, 0);
            pos = position;
            this.texture = sp;
            originVector = new Vector2(texture.Width / 2, texture.Height / 2);
            se = new World.Effects.ShieldEffect();

            radarTexture = Game1.contentManager.Load<Texture2D>("textures/radarTexture");
            barTexture = Game1.contentManager.Load<Texture2D>("textures/barTexture");
            radarRect = new Rectangle((int)radarPosition.X - (int)radarRadius, (int)radarPosition.Y - (int)radarRadius, (int)radarRadius * 2, (int)radarRadius * 2);

            boundRect = new Rectangle((int)position.X - (int)originVector.X, (int)position.Y - (int)originVector.Y, texture.Width, texture.Height);

            health = maxHealth;
            shield = maxShield;
            energy = maxEnergy;

            hpRect = new Rectangle(0, 0, 400 * (int)(health / maxHealth), 50);
            shieldRect = new Rectangle(0, 0, 400 * (int)(shield / maxShield), 50);
            energyRect = new Rectangle(0, 0, 400 * (int)(energy / maxEnergy), 50);

            currentLevel = -1;
            BasicEnemy.enemies = new List<BasicEnemy>();
        }