public override void Update(GameTime gameTime, IUpdatable parent) { Vector2 mousePos = new Vector2(Mouse.GetState().Position.X, Mouse.GetState().Position.Y); Vector2 playerPos = Vector2.Transform(Position, OrionEngine.Instance.GetComponent <Camera2D>().Transform); float armRotation = OrionMath.AngleBetween(mousePos, playerPos); if (armRotation >= 180 && armRotation < 360) { armRotation -= 180; } armRotation -= 90; if (_isInverted) { armRotation *= -1; } if (armRotation >= 360) { armRotation -= 360; } else if (armRotation < 0) { armRotation += 360; } LogManager.Instance.LogMessage(this, _ArmFrontSprite, "Rotation=" + armRotation); _ArmBackSprite.Rotation = armRotation; _ArmFrontSprite.Rotation = armRotation; _GunSprite.Rotation = armRotation; ICollider collider = GetAttachable <ICollider>(); if (Keyboard.GetState().IsKeyDown(Keys.A)) { collider.ApplyLinearImpulse(new Vector2(-0.5f, 0.0f)); } base.Update(gameTime, parent); }