From 25fe5ee634b85a7fc614b4afd727642ed7da5314 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Sat, 10 Jun 2023 17:10:23 -0400 Subject: [PATCH] Danger mouse --- player/player.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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);