public bool MoveTo(GameObject gameObject, Coordinate coordinate, GameAnimation animation) { if (MoveTo(gameObject, coordinate, moveObject: false)) { gameObject.Animate(animation); return(true); } return(false); }
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; }
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(); * }*/ }
public void Animate(GameAnimation gameAnimation) { gameAnimation.SetGameSprite(this); gameAnimation.Run(); }