Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Collision_MoveSnailOnSlopes()

void Terraria.NPC.Collision_MoveSnailOnSlopes ( )
inlineprivate

Definition at line 89414 of file NPC.cs.

89415 {
89416 Vector4 vector = Collision.SlopeCollision(position, velocity, width, height, gravity);
89417 if (position.X != vector.X || position.Y != vector.Y)
89418 {
89419 if (ai[2] == 0f && velocity.Y > 0f && ((direction < 0 && rotation == 1.57f && spriteDirection == 1) || (direction > 0 && rotation == 4.71f && spriteDirection == -1)))
89420 {
89421 direction *= -direction;
89422 }
89423 ai[2] = 2f;
89424 directionY = 1;
89425 rotation = 0f;
89426 }
89427 position.X = vector.X;
89428 position.Y = vector.Y;
89429 velocity.X = vector.Z;
89430 velocity.Y = vector.W;
89431 }
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
int spriteDirection
Definition NPC.cs:517
static float gravity
Definition NPC.cs:129
float[] ai
Definition NPC.cs:447
float rotation
Definition NPC.cs:501
int directionY
Definition NPC.cs:443

References Terraria.Collision.SlopeCollision().