Files
CalamityModPublic/DataStructures/OffscreenBossSpawnContext.cs
T
tomat 67bceff6e7 Initial dotnet format pass.
This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
2024-02-28 21:49:50 -08:00

19 lines
626 B
C#

using System;
using Microsoft.Xna.Framework;
using Terraria;
namespace CalamityMod.DataStructures
{
public class OffscreenBossSpawnContext : BaseBossSpawnContext
{
public override Vector2 DetermineSpawnPosition(Vector2 relativePosition)
{
Vector2 exactPosition = relativePosition;
// Determine the position based on a circlular offset that is always 10% away from the screen points.
exactPosition += Main.rand.NextVector2CircularEdge(Main.screenWidth, Main.screenHeight) * (float)Math.Sqrt(2f) * 1.1f * 0.5f;
return exactPosition;
}
}
}