Danger mouse
This commit is contained in:
parent
b982ffb7c4
commit
25fe5ee634
@ -21,21 +21,26 @@ public partial class player : Camera3D
|
|||||||
public override void _Process(double delta)
|
public override void _Process(double delta)
|
||||||
{
|
{
|
||||||
Vector3 rot = this.Rotation;
|
Vector3 rot = this.Rotation;
|
||||||
|
bool zin = true, zout = true;
|
||||||
|
|
||||||
this.Rotation -= rot;
|
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));
|
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));
|
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));
|
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.Translate(new Vector3(0, 0, (float)delta*10));
|
||||||
this.Rotation += rot;
|
this.Rotation += rot;
|
||||||
|
|
||||||
if (_wIn && this.Position.Z > 3)
|
if (_wIn && zin)
|
||||||
this.Translate(new Vector3(0, 0, (float)-delta*10));
|
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));
|
this.Translate(new Vector3(0, 0, (float)delta*10));
|
||||||
|
|
||||||
_con.Set("text", this.Position);
|
_con.Set("text", this.Position);
|
||||||
|
Loading…
Reference in New Issue
Block a user