Example #1
0
 public bool MoveTo(GameObject gameObject, Coordinate coordinate, GameAnimation animation)
 {
     if (MoveTo(gameObject, coordinate, moveObject: false))
     {
         gameObject.Animate(animation);
         return(true);
     }
     return(false);
 }
Example #2
0
        public void AddWalkAnimation(GamePlayerDirection direction, GameAnimation animation)
        {
            if (animationDictionary.ContainsKey(direction))
            {
                animationDictionary.Add(direction, animation);
            }
            else
            {
                animationDictionary[direction] = animation;
            }

            animation.OnStart  += onAnimationStart;
            animation.OnFinish += onAnimationFinish;
        }
Example #3
0
        public void MoveTo(GameObject gameObject, Coordinate cordinates, GameAnimation animation)
        {
            GameObject oldGameObject = currentMap.GetGameObjectAt(cordinates.Row, cordinates.Col);

            currentMap.MoveTo(gameObject, cordinates, animation);


            /*if (oldGameObject != null && oldGameObject.Type == GameObject.GameObjectType.Batery)
             * {
             *  MessageBox.Show("Bateria");
             * }
             * else if (oldGameObject != null && oldGameObject.Type == GameObject.GameObjectType.Target)
             * {
             *  MessageBox.Show("Ganhou");
             * }
             * else
             * {
             *  decreseEnergy();
             * }*/
        }
Example #4
0
 public void Animate(GameAnimation gameAnimation)
 {
     gameAnimation.SetGameSprite(this);
     gameAnimation.Run();
 }