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; } }
public void Update() //PRAISE THE SUN { if (!IsAlive) { return;//Dead } IEnemyCollisionManager.HandleMovement(this); sprite.Update(); }
public void Update() { if (!IsAlive) { return;//Dead } if (isJumping) { IEnemyCollisionManager.HandleMovement(this); } else { jumpCurrent = (jumpCurrent + 1) % jumpFrequency; if (jumpCurrent == 0) { isJumping = true; } } sprite.Update(); }
public void Update() { IEnemyCollisionManager.HandleMovement(this); sprite.Update(); }