Esempio n. 1
0
        public PlayerHUDStatus(Vector2 size, Vetbol player, TimeSpan timer)
        {
            this.size = size;
            this.player = player;

            playerImage = new Sprite();
            playerFrame = new Sprite();

            playerFrame.Position.X = (size.X / 2) -((96 / Controller.CurrentDrawCamera.zoom) / 2) + (float)player.index * size.X;
            playerFrame.Position.Y = this.Position.Y;
            playerFrame.Scale /= Controller.CurrentDrawCamera.zoom;

            playerImage.Position.X = playerFrame.Position.X + ((96 - 20) / 2) - (playerImage.Width / 2);
            playerImage.Position.Y = this.Position.Y + ((96 - 65) / 2);
            playerImage.Scale /= Controller.CurrentDrawCamera.zoom;

            playerFrame.LoadTexture(Controller.Content.Load<Texture2D>(@"Assets/peter4croisants"), 96, 96);
            playerFrame.AddAnimation("IDLE", new int[1] { 0 }, 0);
            playerFrame.AddAnimation("LOADING", new int[12] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, (float)timer.TotalSeconds / 12);

            this.playerImage.LoadTexture(Controller.Content.Load < Texture2D >(@"images/slimeblobOther"), 48, 48);

            this.playerImage.Color = player.image.Color;

            this.playerTickets = new Label(player.score.ToString(), Controller.FontController.GetFont("DefaultFont"));
            this.playerTickets.Position = new Vector2(playerImage.Position.X + 10, this.Position.Y + 115);
            this.playerTickets.Scale /= Controller.CurrentDrawCamera.zoom - 0.3f;

            this.AddChild(playerFrame);
            this.AddChild(playerImage);
            this.AddChild(playerTickets);
        }
Esempio n. 2
0
        public void startCapturing(Vetbol vetblob)
        {
            if (!isPlayerCapturing)
                soundTakeOver.Play();

            isPlayerCapturing = true;
            playerCapturing = vetblob;
        }
        public void startCapturing(Vetbol vetblob)
        {
            if (!isPlayerCapturing)
            {
                soundTakeOver.Play();
            }

            isPlayerCapturing = true;
            playerCapturing   = vetblob;
        }
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            this.BloodParticles.Position = this.Position + new Vector2(55, 53);

            if (!this.isCollidingPlayer)
            {
                timer = 0;
                this.playerCapturing   = null;
                this.isPlayerCapturing = false;
            }
            if (isPlayerCapturing == true && playerCapturing != owner)
            {
                timer += gameTime.ElapsedGameTime.TotalSeconds;
                takingOverRectangle.Scale.X = (float)(1 - (timer / 2));
                takingOverRectangle.Visable = true;
            }
            else
            {
                takingOverRectangle.Visable = false;
            }

            if (timer >= 2)
            {
                takingOverRectangle.Visable = false;
                timer    = 0;
                captured = true;
                owner    = playerCapturing;
                soundTaken.Play(0.2f, 0, 0);

                if (owner.index == PlayerIndex.One)
                {
                    PlayAnimation("p1captured");
                }

                if (owner.index == PlayerIndex.Two)
                {
                    PlayAnimation("p2captured");
                }
                if (owner.index == PlayerIndex.Three)
                {
                    PlayAnimation("p3captured");
                }
                if (owner.index == PlayerIndex.Four)
                {
                    PlayAnimation("p4captured");
                }
            }

            this.isCollidingPlayer = false;
        }
Esempio n. 5
0
        public PlayerHUDStatus(Vector2 size, Vetbol player, TimeSpan timer)
        {
            this.size   = size;
            this.player = player;

            playerImage = new Sprite();
            playerFrame = new Sprite();

            playerFrame.Position.X = (size.X / 2) - ((96 / Controller.CurrentDrawCamera.zoom) / 2) + (float)player.index * size.X;
            playerFrame.Position.Y = this.Position.Y;
            playerFrame.Scale     /= Controller.CurrentDrawCamera.zoom;

            playerImage.Position.X = playerFrame.Position.X + ((96 - 20) / 2) - (playerImage.Width / 2);
            playerImage.Position.Y = this.Position.Y + ((96 - 65) / 2);
            playerImage.Scale     /= Controller.CurrentDrawCamera.zoom;

            playerFrame.LoadTexture(Controller.Content.Load <Texture2D>(@"Assets/peter4croisants"), 96, 96);
            playerFrame.AddAnimation("IDLE", new int[1] {
                0
            }, 0);
            playerFrame.AddAnimation("LOADING", new int[12] {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
            }, (float)timer.TotalSeconds / 12);


            this.playerImage.LoadTexture(Controller.Content.Load <Texture2D>(@"images/slimeblobOther"), 48, 48);

            this.playerImage.Color = player.image.Color;

            this.playerTickets          = new Label(player.score.ToString(), Controller.FontController.GetFont("DefaultFont"));
            this.playerTickets.Position = new Vector2(playerImage.Position.X + 10, this.Position.Y + 115);
            this.playerTickets.Scale   /= Controller.CurrentDrawCamera.zoom - 0.3f;

            this.AddChild(playerFrame);
            this.AddChild(playerImage);
            this.AddChild(playerTickets);
        }
        internal void Activate(Vetbol vetbol)
        {
            this.Vetbol = vetbol;

            this.Activate();
        }
Esempio n. 7
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            this.BloodParticles.Position = this.Position + new Vector2(55, 53);

            if (!this.isCollidingPlayer)
            {
                timer = 0;
                this.playerCapturing = null;
                this.isPlayerCapturing = false;
            }
            if (isPlayerCapturing == true && playerCapturing != owner)
            {
                timer += gameTime.ElapsedGameTime.TotalSeconds;
                takingOverRectangle.Scale.X = (float)(1-(timer / 2));
                takingOverRectangle.Visable = true;
            }
            else
            {
                takingOverRectangle.Visable = false;
            }

            if (timer >= 2)
            {
                takingOverRectangle.Visable = false;
                timer = 0;
                captured = true;
                owner = playerCapturing;
                soundTaken.Play(0.2f, 0, 0);

                if (owner.index == PlayerIndex.One)
                {
                    PlayAnimation("p1captured");
                }

                if (owner.index == PlayerIndex.Two)
                {
                    PlayAnimation("p2captured");
                }
                if (owner.index == PlayerIndex.Three)
                {
                    PlayAnimation("p3captured");
                }
                if (owner.index == PlayerIndex.Four)
                {
                    PlayAnimation("p4captured");
                }

            }

            this.isCollidingPlayer = false;
        }
Esempio n. 8
0
 public void PlayerSpawned(Vetbol player)
 {
     hudPlayers[player.index].ToNormal();
 }
Esempio n. 9
0
 public void PlayerDied(Vetbol player)
 {
     hudPlayers[player.index].Load();
 }
Esempio n. 10
0
 public void PlayerSpawned(Vetbol player)
 {
     hudPlayers[player.index].ToNormal();
 }
Esempio n. 11
0
 public void PlayerDied(Vetbol player)
 {
     hudPlayers[player.index].Load();
 }
Esempio n. 12
0
        internal void Activate(Vetbol vetbol)
        {
            this.Vetbol = vetbol;

            this.Activate();
        }