diff --git a/player/player.cs b/player/player.cs index 165c2e5..683aa5f 100644 --- a/player/player.cs +++ b/player/player.cs @@ -21,21 +21,26 @@ public partial class player : Camera3D public override void _Process(double delta) { Vector3 rot = this.Rotation; + bool zin = true, zout = true; this.Rotation -= rot; - if (_mLeft) + if (this.Position.Y < 5) + zin = false; + else if (this.Position.Y > 20) + zout = false; + if (_mLeft && this.Position.X > -30) this.Translate(new Vector3((float)-delta*10, 0, 0)); - if (_mRight) + if (_mRight && this.Position.X < 30) this.Translate(new Vector3((float)delta*10, 0, 0)); - if (_mUp) + if (_mUp && this.Position.Z > -25) this.Translate(new Vector3(0, 0, (float)-delta*10)); - if (_mDown) + if (_mDown && this.Position.Z < 25) this.Translate(new Vector3(0, 0, (float)delta*10)); this.Rotation += rot; - if (_wIn && this.Position.Z > 3) + if (_wIn && zin) this.Translate(new Vector3(0, 0, (float)-delta*10)); - if (_wOut && this.Position.Z < 12) + if (_wOut && zout) this.Translate(new Vector3(0, 0, (float)delta*10)); _con.Set("text", this.Position);