protected override bool CollidedWithPlayer(BosuPlayer player) { // Let's assume that player is a circle for simplicity var playerPosition = player.PlayerPositionInPlayfieldSpace(); var distance = Math.Sqrt(Math.Pow(Math.Abs(playerPosition.X - Position.X), 2) + Math.Pow(Math.Abs(playerPosition.Y - Position.Y), 2)); var playerRadius = player.PlayerDrawSize().X / 2f; var cherryRadius = finalSize / 2f; if (distance < playerRadius + cherryRadius) { return(true); } return(false); }
public BosuPlayfield() { InternalChildren = new Drawable[] { new BosuBackground(), new Container { RelativeSizeAxes = Axes.Both, Masking = true, Children = new Drawable[] { HitObjectContainer, Player = new BosuPlayer() } } }; }
public BosuPlayfield() { Origin = Anchor.Centre; Anchor = Anchor.Centre; Masking = true; InternalChildren = new Drawable[] { bg = new PlayfieldBackground(), new Container { RelativeSizeAxes = Axes.Both, Child = HitObjectContainer }, new BosuPlayfieldBorder(), Player = new BosuPlayer(), enteringOverlay = new EnteringOverlay { Alpha = UseEnteringAnimation ? 1 : 0 }, deathOverlay = new DeathOverlay() }; }
protected abstract bool CollidedWithPlayer(BosuPlayer player);
public void GetPlayerToTrace(BosuPlayer player) => Player = player;
protected override bool CollidedWithPlayer(BosuPlayer player) => false;