public override void Exit(object owner)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
            }
        }
示例#2
0
        public MousePointer(CommandManager commandManager, PlayerGameObject player)
        {
            this.commandManager = commandManager;

            this.player = player;

            //commandManager.m_Input.OnKeyPressed += MousePressed;
        }
示例#3
0
        public override void Exit(object owner)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
                currentTime = 0.0;
            }
        }
        public override void Execute(object owner, GameTime gameTime)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
                player.MoveTowardEntity(player.target, gameTime);
            }
        }
        public override void Enter(object owner)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
                player.state = PlayerGameObject.PlayerState.Chase;
            }
        }
示例#6
0
        public override void Exit(object owner)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
                player.Speed = player.MaxSpeed;
            }
        }
示例#7
0
        public override void Enter(object owner)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
                player.state = PlayerGameObject.PlayerState.Walk;
                player.Speed = player.MaxSpeed;
            }
        }
示例#8
0
        public override void Enter(object owner)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player != null)
            {
                //player.Speed = 0;
                player.state = PlayerGameObject.PlayerState.Attack;
                currentTime  = 0.0;
            }
        }
示例#9
0
        public void InitialiseMainGameState()
        {
            entities = new List <GameObjectBase>();

            mapManager       = new MapManager();
            collisionManager = new CollisionManager();

            player = new PlayerGameObject();
            player.Initialise();

            Commands = new CommandManager();

            mousePointer = new MousePointer(Commands, player);

            InitialiseBindings();
        }
示例#10
0
        public void UnloadMainGameContent()
        {
            //clear registered events
            player.CollideWithEnemy -= CollideWithEnemyTest;
            player.DamageEnemy      -= player.Damage;

            //mousePointer.SelectEnemy -= mousePointer.MouseSelectEntity;

            foreach (EnemyGameObject enemy in enemies)
            {
                enemy.DamagePlayer -= HurtPlayerTest;
                enemy.EnemyDies    -= SpawnPotion;
            }

            potions.Clear();
            enemies.Clear();
            player = null;
            entities.Clear();
            collisionManager = null;
            Commands         = null;
            ClearMapTypes();
            Resources.UnloadContent(Content);
            MediaPlayer.Stop();

            #region Constrain mouse to window - not implemented

            //if (Mouse.GetState().X < 0)

            //    Mouse.SetPosition(0, Mouse.GetState().Y);

            //if (Mouse.GetState().X > ScreenWidth)

            //    Mouse.SetPosition(ScreenHeight, Mouse.GetState().Y);

            //if (Mouse.GetState().Y < 0)

            //    Mouse.SetPosition(Mouse.GetState().X, 0);

            //if (Mouse.GetState().Y > ScreenWidth)

            //    Mouse.SetPosition(Mouse.GetState().X, ScreenHeight);

            #endregion
            base.UnloadContent();
        }
        public override void Execute(object owner, GameTime gameTime)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player == null)
            {
                return;
            }

            if (currentTime >= dyingTime)
            {
                player.Die();
                currentTime = 0.0;
            }
            else
            {
                currentTime += gameTime.ElapsedGameTime.TotalSeconds;
            }
        }
示例#12
0
        public override void Execute(object owner, GameTime gameTime)
        {
            PlayerGameObject player = owner as PlayerGameObject;

            if (player == null)
            {
                return;
            }

            if (currentTime >= attackCooldownTime)
            {
                //player.MoveTowardEntity(player.target, gameTime);
                player.Attack();
                currentTime = 0.0f;
            }
            else
            {
                currentTime += gameTime.ElapsedGameTime.TotalSeconds;
            }
        }
示例#13
0
 //TODO: put these methods into appropriate managing class
 private void HurtEnemyTest(object attacker, object receiver, EventArgs e)
 {
     PlayerGameObject player = attacker as PlayerGameObject;
 }
示例#14
0
 public override void Execute(object owner, GameTime gameTime)
 {
     PlayerGameObject player = owner as PlayerGameObject;
 }