public override void PlayerControl(Input input) { stick = input.GetRightStick(); if (input.BtnDown(InputButtons.RightTrigger_Mouse1)) { if (!beamNode.active) beamNode.active = true; if (currentlyColliding.Count != 0) { if (goThrough) { int count = currentlyColliding.Count; for (int i = 0; i < count; i++) { ApplyEffect(currentlyColliding.Dequeue()); } ResizeBeam(maxLength); } else { int count = currentlyColliding.Count; float closest = float.MaxValue; Node closestNode = null; for (int i = 0; i < count; i++) { Node n = currentlyColliding.Dequeue(); float dist = (n.body.pos - parent.body.pos).Length(); if (dist < closest) { closest = dist; closestNode = n; } } currentLength = closest - closestNode.body.radius * 0.9f; //only support for circles for now if (currentLength > maxLength) currentLength = maxLength; ResizeBeam(currentLength); ApplyEffect(closestNode); } } else { if (growing) { currentLength = Math.Min(maxLength, currentLength + growthRate); ResizeBeam(currentLength); } else { ResizeBeam(maxLength); } } } else { if (beamNode.active) beamNode.active = false; currentLength = minLength; } }
public override void PlayerControl(Input input) { if (fireMode == mode.SingleFire) { if (input.BtnDown(InputButtons.RightTrigger_Mouse1)) { if (!input.oldInputState.IsButtonDown(InputButtons.RightTrigger_Mouse1)) { FireNode(input.GetRightStick()); } else if (steerNode && lastFired != null) { lastFired.body.velocity = VMath.VectorRotateLerp(lastFired.body.velocity, input.GetRightStick(), 0.02f); } } } else if (fireMode == mode.AutoFire) { if (input.BtnDown(InputButtons.RightTrigger_Mouse1)) { if (shootingDelayCount++ % shootingDelay == 0) { FireNode(input.GetRightStick()); } } } if (input.BtnClicked(InputButtons.RightBumper_E)) { if (room.groups.general.childGroups.Values.Count < 2) return; bool next = false; var tempGroup = room.groups.general.childGroups; for (int i = 0; i < tempGroup.Values.Count; i++) { Group g = tempGroup.Values.ElementAt(i); if (next) { currentGroup = g; break; } if (g == currentGroup) { if (i == tempGroup.Values.Count - 1) { currentGroup = tempGroup.Values.ElementAt(0); break; } next = true; } } } }
public override void PlayerControl(Input input) { if (shootMode == ShootMode.Rapid) { if (input.BtnDown(InputButtons.RightTrigger_Mouse1)) { if (shootingRateCount++ % shootingDelay == 0) { FireNode(input.GetRightStick()); } } else { shootingRateCount = 0; } } else if (shootMode == ShootMode.Single) { //if (fc.newGamePadState.IsButtonDown(Buttons.RightTrigger) && fc.oldGamePadState.IsButtonUp(Buttons.RightTrigger)) if (input.BtnClicked(InputButtons.RightTrigger_Mouse1)) { if (shootingRateCount++ % shootingDelay == 0) { FireNode(input.GetRightStick()); } } else { shootingRateCount = 0; } } else if (shootMode == ShootMode.Auto) { Vector2 rightstick = input.GetRightStick(); if (rightstick != Vector2.Zero) { if (shootingRateCount++ % shootingDelay == 0) { FireNode(rightstick); } } else { shootingRateCount = 0; } } }