コード例 #1
0
 private void MoveColliders(List <ICollidable> collidableList, float moveSpeed)
 {
     foreach (ICollidable collidable in collidableList)
     {
         Vector2 oldVelocity = collidable.Velocity;
         collidable.Velocity = new Vector2(moveSpeed, 0);
         if (collidable is AbstractCharacter)
         {
             CharacterCollisionManager.HandleMovementAndCollisions((AbstractCharacter)collidable);
         }
         else if (collidable is PickupItem)
         {
             IItemCollisionManager.HandleMovement((PickupItem)collidable);
         }
         else if (collidable is CrateItem)
         {
             IItemCollisionManager.HandleMovement((CrateItem)collidable);
         }
         else if (collidable is IEnemy)
         {
             IEnemyCollisionManager.HandleMovement((IEnemy)collidable);
         }
         collidable.Velocity = oldVelocity;
     }
 }
コード例 #2
0
        public void Update() //PRAISE THE SUN
        {
            if (!IsAlive)
            {
                return;//Dead
            }
            IEnemyCollisionManager.HandleMovement(this);

            sprite.Update();
        }
コード例 #3
0
        public void Update()
        {
            if (!IsAlive)
            {
                return;//Dead
            }
            if (isJumping)
            {
                IEnemyCollisionManager.HandleMovement(this);
            }
            else
            {
                jumpCurrent = (jumpCurrent + 1) % jumpFrequency;
                if (jumpCurrent == 0)
                {
                    isJumping = true;
                }
            }

            sprite.Update();
        }
コード例 #4
0
 public void Update()
 {
     IEnemyCollisionManager.HandleMovement(this);
     sprite.Update();
 }