// Start is called before the first frame update void Start() { score = 0; isGameOver = false; moveProvider = GetComponent <MovementProvider>(); musicSource = GetComponent <AudioSource>(); }
public AnimatedMovement(Animation animation, Movement movement) { this.animation = animation; movement.Redefine(); if (animation.HasChild) { switch (animation.MovementBehavior) { case MovementBehavior.ActAndDelegate: child = new AnimatedMovement(animation.Child.Clone(), movement.Clone()); this.movement = movement; break; case MovementBehavior.Act: child = new AnimatedMovement(animation.Child.Clone(), MovementProvider.GetStaticMovement(movement.Origin)); this.movement = movement; break; case MovementBehavior.Delegate: child = new AnimatedMovement(animation.Child.Clone(), movement.Clone()); this.movement = MovementProvider.GetStaticMovement(movement.Origin); break; } } else { this.movement = movement; } Origin = movement.Origin; }
public void AddAnimatedMovement(AnimationType key, Point startCell, Point endCell, float speed) { Animation nextAnimation = definedAnimations[key].Clone(); nextAnimation.LayerDepth = LayerDepth; nextAnimation.ColorModifier = ColorModifier; AnimatedMovement nextAction = new AnimatedMovement(nextAnimation, MovementProvider.GetMapMovement(startCell, endCell, speed)); AddNextAction(nextAction); }
public void AddAnimatedMovement(AnimationType key, Point cell) { Animation nextAnimation = definedAnimations[key].Clone(); nextAnimation.LayerDepth = LayerDepth; nextAnimation.ColorModifier = ColorModifier; AnimatedMovement nextAction = new AnimatedMovement(nextAnimation, MovementProvider.GetStaticMovement(cell)); AddNextAction(nextAction); }
public void AddAnimatedMovement(AnimationType key, Vector2 origin, Vector2 destiny, float speed) { Animation nextAnimation = definedAnimations[key].Clone(); nextAnimation.LayerDepth = LayerDepth; nextAnimation.ColorModifier = ColorModifier; AnimatedMovement nextAction = new AnimatedMovement(nextAnimation, MovementProvider.GetDirectMovement(origin, destiny, speed)); AddNextAction(nextAction); }
public override void LoadContent() { lineMotions = new List <Movement>(); movingLinesIndex = new List <int>(); foreach (String textLine in textLines) { Movement lineMotion = MovementProvider.GetDirectMovement( new Vector2(TEXT_X_POSITION, START_TEXT_Y_POSITION), new Vector2(TEXT_X_POSITION, END_TEXT_Y_POSITION), TEXT_SPEED); lineMotions.Add(lineMotion); } lineGapBuffer = LINE_GAP_TIME; }
public Pointer(List <IMenuItem> menuItems) : base(new Animation(AnimationType.StaticRight), MovementProvider.GetDirectMovement(menuItems[0].Position, menuItems[0].Position, POINTER_SPEED)) { Animation.IsCyclic = false; List <Texture2D> sprites = new List <Texture2D>() { IO.LoadSingleTexture(POINTER_PATH) }; Animation.Sprites = sprites; Animation.LayerDepth = Constants.LD_INTERFACE_0; selection = 0; this.menuItems = menuItems; base.Start(); }
public void SoftMove(Point destiny) { softMoveStartLocation = cameraLocation; destiny.X -= cameraSize.X / 2; destiny.Y -= cameraSize.Y / 2; if (destiny.X < 0) { destiny.X = 0; } if (destiny.Y < 0) { destiny.Y = 0; } if (destiny.X + cameraSize.X > map.Width) { destiny.X = map.Width - cameraSize.X; } if (destiny.Y + cameraSize.Y > map.Height) { destiny.Y = map.Height - cameraSize.Y; } destiny.X -= cameraLocation.X; destiny.Y -= cameraLocation.Y; softMoveDisplacement = new Point(destiny.X, destiny.Y); destiny.X *= Constants.TILE_SIZE; destiny.Y *= Constants.TILE_SIZE; softMove = MovementProvider.GetDirectMovement(Vector2.Zero, new Vector2(destiny.X, destiny.Y), CAMERA_SPEED); softMove.Start(); moving = true; updateLocations = true; }
public void Execute() { if (!IsUnitValid(ActiveTarget)) { ActiveTarget = SelectNewTarget(); AmeisenBotLogger.Instance.Log($"[{WowActionExecutor?.ProcessId.ToString("X" , CultureInfo.InvariantCulture.NumberFormat)}]\tNew ActiveTarget is: {ActiveTarget?.Name}"); return; } WowPosition positionToMoveTo = MovementProvider?.GetPositionToMoveTo(WowDataAdapter.ActivePlayerPosition, WowDataAdapter.GetPosition(ActiveTarget.BaseAddress)) ?? new WowPosition(); WowActionExecutor.MoveToPosition(positionToMoveTo); WowUnit player = (WowUnit)WowDataAdapter.ObjectManager.GetWowObjectByGuid(WowDataAdapter.PlayerGuid); if (ActiveTarget?.Guid != 0 && player.TargetGuid != ActiveTarget.Guid) { WowActionExecutor.TargetGuid(ActiveTarget.Guid); } WowActionExecutor.AttackUnit(ActiveTarget); /*SpellStrategy?.GetSpellToCast(player, ActiveTarget);*/ }