コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     score        = 0;
     isGameOver   = false;
     moveProvider = GetComponent <MovementProvider>();
     musicSource  = GetComponent <AudioSource>();
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: ScriptScreen.cs プロジェクト: otnemarcas/amude
        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;
        }
コード例 #7
0
        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();
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        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);*/
        }