public ButtonUp(InputVirtualKey button) { this.button = button; }
public ButtonHold(InputVirtualKey button, double dt) { this.button = button; this.dt = dt; }
public ButtonPress(InputVirtualKey button) { this.button = button; }
internal void UpdateRotation(InputVirtualKey inputVirtualKey, double dt) { switch (inputVirtualKey) { case InputVirtualKey.AxisLeft: angle += (float)dt * rotationSpeed; break; case InputVirtualKey.AxisRight: angle -= (float)dt * rotationSpeed; break; } if (angle > 360) angle -= 360; if (angle < 0) angle += 360; this.velocity = Misc.RotateVector(initialFacing, angle) * this.velocity.Length; MessageDispatcher.Post(new SetPosition(this.owner, this.velocity, this.position, this.angle, this.lastDT, Misc.RotateVector(initialFacing, angle))); //MessageDispatcher.Post(new TraceText("Velocity: " + this.Velocity.ToString() + ", Angle: " + angle)); }