Esempio n. 1
0
        public PlayerFish(Player player)
        {
            this.Player = player;

              this.Sprite = GraphicsManager.GetSprite(NibblyFishGame.Textures.DiddyFish);

              this.Sprite.Color = Color.Orange;
        }
Esempio n. 2
0
        internal static void SetupPlayers()
        {
            if (_numPlayers >= 1)
            {
            Player player1 = new Player(0);
            PlayerFish playerFish = new PlayerFish(player1)
            {
                // Keyboard input 1
                MovementBehaviour = new KeyboardMovementBehaviour(0),
                RespawnPoint = new Point(30, (int)((GraphicsManager.ScreenHeight * 0.5) - (GraphicsManager.GetSprite(NibblyFishGame.Textures.DiddyFish).Height * 0.5)))
            };

            playerFish.Position.X = playerFish.RespawnPoint.X;
            playerFish.Position.Y = playerFish.RespawnPoint.Y;

            _aquariumScreen.Elements.Add(playerFish);

            playerFish.Initialize();
            }

            if (_numPlayers >= 2)
            {
            Player player2 = new Player(1);

            PlayerFish playerFish = new PlayerFish(player2)
            {
                // Keyboard input 1
                MovementBehaviour = new KeyboardMovementBehaviour(1),
                RespawnPoint = new Point(GraphicsManager.ScreenWidth - 30, (int)((GraphicsManager.ScreenHeight * 0.5) - (GraphicsManager.GetSprite(NibblyFishGame.Textures.DiddyFish).Height * 0.5)))
            };

            playerFish.Position.X = playerFish.RespawnPoint.X;
            playerFish.Position.Y = playerFish.RespawnPoint.Y;

            _aquariumScreen.Elements.Add(playerFish);

            playerFish.Initialize();
            }
        }