public void CollideWith(INonReactiveDrawableCollideable other) { CollideInfo info = other.GetCollideInfo(this); if (info.Orientation == Orientation.Horizontal) { this.velocityState.YVelocity *= -1; if (info.CollidePercentage >= 0) { this.velocityState.XVelocity = (int)(30 * info.CollidePercentage - 15); } } else { this.velocityState.XVelocity *= -1; } }
public void CollideWith(INonReactiveCollideable other) { CollideInfo info = other.GetCollideInfo(this); if (info.orientation == PongGame.Orientation.HORIZONTAL) { yVelocity *= -1; if (info.collidePercentage >= 0) { xVelocity = (int)(30 * info.collidePercentage - 15); } } else { xVelocity *= -1; } }
public Wall(Side side) : base(true) { this.side = side; collideInfo = new CollideInfo(SetPosition(), -1); }