Beispiel #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;
     }
 }
 protected void UpdateHitbox()
 {
     CharacterCollisionManager.HandleMovementAndCollisions(this);
 }