public void Execute() { firstEntity.Location = new Vector2(firstEntity.Location.X, firstEntity.Location.Y - collision.Overlap.Height); collision.FirstEntity.Hitbox = new Rectangle((int)firstEntity.Location.X, (int)firstEntity.Location.Y, collision.FirstEntity.Hitbox.Width, collision.FirstEntity.Hitbox.Height); IPhysics physicsFirstEntity = (IPhysics)firstEntity; physicsFirstEntity.Velocity = new Vector2(physicsFirstEntity.Velocity.X, 0); if (secondEntity.BumpState is BumpedBlockState) { firstEntity.Bounce(); } }
public void Execute() { firstEntity.Location = new Vector2(firstEntity.Location.X, firstEntity.Location.Y - collision.Overlap.Height); collision.FirstEntity.Hitbox = new Rectangle((int)firstEntity.Location.X, (int)firstEntity.Location.Y, collision.FirstEntity.Hitbox.Width, collision.FirstEntity.Hitbox.Height); firstEntity.Bounce(); }