FANDOM


This class handles collision detection for the game. An understanding of this class is helpful in creating custom-ai NPCs. More info is needed on this page, as it is fairly new.

Read More


PropertiesEdit

Name Type Description
down bool
up bool

Methods Edit

Method Name Description
AnyCollision()
public static Vector2 AnyCollision(Vector2 Position, Vector2 Velocity, int Width, int Height)
{
}

Returns adjusted velocity based on collision with ANY tile (including the background).

CanHit()
public static bool CanHit(Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2)
{
}

Checks line of sight between two items, players, npcs, projectiles, whatever. Very useful for ai.

DrownCollision()
public static bool DrownCollision(Vector2 Position, int Width, int Height, float gravDir = -1f)
{
}
  • (needs description)
EmptyTile()
public static bool EmptyTile(int i, int j, bool ignoreTiles = false)
{
}
  • (needs description)
HitTiles()
public static void HitTiles(Vector2 Position, Vector2 Velocity, int Width, int Height)
{
}

Checks if there are tiles in the position of Position+Velocity, and destroys them if there are.

HurtTiles()
public static Vector2 HurtTiles(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fireImmune = false)
{
}
  • (needs description)
LavaCollision()
public static bool LavaCollision(Vector2 Position, int Width, int Height)
{
}
  • (needs description)
SolidCollision()
public static bool SolidCollision(Vector2 Position, int Width, int Height)
{
}
  • (needs description)
SolidTiles()
public static bool SolidTiles(int startX, int endX, int startY, int endY)
{
}
  • (needs description)
StickyTiles()
public static Vector2 StickyTiles(Vector2 Position, Vector2 Velocity, int Width, int Height)
{
}
  • (needs description)
SwitchTiles()
public static bool SwitchTiles(Vector2 Position, int Width, int Height, Vector2 oldPosition)
{
}
  • (needs description)
TileCollision()
public static Vector2 TileCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough = false, bool fall2 = false)
{
}

Returns adjusted velocity based on collision with tiles (use for most custom NPC ai collisions).

WaterCollision()
public static Vector2 WaterCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough = false, bool fall2 = false)
{
}
  • (needs description)
WetCollision()
public static bool WetCollision(Vector2 Position, int Width, int Height)
{
}
  • (needs description)
Classes in Terraria

Chest | Cloud | Collision | Dust | Gore | Item | Lighting | Liquid | Main | NPC | Player | Projectile | Recipe | Sign | Star | WorldGen


Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.