Example #1
0
 public ButtonUp(InputVirtualKey button)
 {
     this.button = button;
 }
Example #2
0
 public ButtonHold(InputVirtualKey button, double dt)
 {
     this.button = button;
     this.dt = dt;
 }
Example #3
0
 public ButtonPress(InputVirtualKey button)
 {
     this.button = button;
 }
Example #4
0
        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));
        }