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

◆ BordersMovement()

void Terraria.Player.BordersMovement ( )
inline

Definition at line 23080 of file Player.cs.

23081 {
23082 if (position.X < Main.leftWorld + 640f + 16f)
23083 {
23084 Main.cameraX = 0f;
23085 position.X = Main.leftWorld + 640f + 16f;
23086 velocity.X = 0f;
23087 }
23088 if (position.X + (float)width > Main.rightWorld - 640f - 32f)
23089 {
23090 Main.cameraX = 0f;
23091 position.X = Main.rightWorld - 640f - 32f - (float)width;
23092 velocity.X = 0f;
23093 }
23094 if (position.Y < Main.topWorld + 640f + 16f)
23095 {
23096 if (Main.remixWorld || forcedGravity > 0)
23097 {
23098 if (position.Y < Main.topWorld + 640f + 16f - (float)height && !dead)
23099 {
23100 KillMe(PlayerDeathReason.ByOther(19), 10.0, 0);
23101 }
23102 if (position.Y < Main.topWorld + 320f + 16f)
23103 {
23104 position.Y = Main.topWorld + 320f + 16f;
23105 if (velocity.Y < 0f)
23106 {
23107 velocity.Y = 0f;
23108 }
23109 gravDir = 1f;
23110 }
23111 }
23112 else
23113 {
23114 position.Y = Main.topWorld + 640f + 16f;
23115 if ((double)velocity.Y < 0.11)
23116 {
23117 velocity.Y = 0.11f;
23118 }
23119 gravDir = 1f;
23120 }
23122 }
23123 if (position.Y > Main.bottomWorld - 640f - 32f - (float)height)
23124 {
23125 position.Y = Main.bottomWorld - 640f - 32f - (float)height;
23126 velocity.Y = 0f;
23127 }
23128 if (position.Y > Main.bottomWorld - 640f - 150f - (float)height)
23129 {
23131 }
23132 }
static PlayerDeathReason ByOther(int type)
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static void HandleSpecialEvent(Player player, int eventID)
void KillMe(PlayerDeathReason damageSource, double dmg, int hitDirection, bool pvp=false)
Definition Player.cs:36665

References Terraria.Main.bottomWorld, Terraria.DataStructures.PlayerDeathReason.ByOther(), Terraria.GameContent.Achievements.AchievementsHelper.HandleSpecialEvent(), Terraria.Main.leftWorld, Terraria.Main.remixWorld, Terraria.Main.rightWorld, and Terraria.Main.topWorld.