private void OnPacmanAnimationTimerElapsed(object sender, ElapsedEventArgs e)
        {
            //so we have to call the dispatcher to grab authority over the GUI
            _gameView.GameCanvas.Dispatcher.Invoke(() =>
            {
                //set playeranimation
                _player.Image.Source = _pacmanAnimation.SetAnimation(_player.CurrentMove);

                //set enemyanimation
                _playgroundObjects.Where(x => x.ObjectType == ObjectType.Enemy).Cast <MovableObject>().ToList().ForEach(x =>
                {
                    x.Image.Source = _enemyAnimation.SetAnimation(x.CurrentMove);
                });
            });
        }
예제 #2
0
 void Start()
 {
     m_enemyAnim.SetAnimation(EnemyAnimationStatus.Run);
 }