public void AttackWithCatapult() { catapult.Fire(); turnsPassed += 1; onTurnFinished(); Debug.Log("Used Attack with catapult"); }
public void elegirAccion() { if (Input.GetKeyDown(KeyCode.W)) { catapult.Fire(); } if (Input.GetKeyDown(KeyCode.Space)) { rayBeam.Fire(); } }
/// <summary> /// Function processes the user input /// </summary> /// <param name="gestureSample"></param> public void HandleInput(GestureSample gestureSample) { // Process input only if in Human's turn if (IsActive) { // Process any Drag gesture if (gestureSample.GestureType == GestureType.FreeDrag) { // If drag just began save the sample for future // calculations and start Aim "animation" if (null == firstSample) { firstSample = gestureSample; Catapult.CurrentState = CatapultState.Aiming; } // save the current gesture sample prevSample = gestureSample; // calculate the delta between first sample and current // sample to present visual sound on screen Vector2 delta = prevSample.Value.Position - firstSample.Value.Position; Catapult.ShotStrength = delta.Length() / maxDragDelta; float baseScale = 0.001f; arrowScale = baseScale * delta.Length(); isDragging = true; } else if (gestureSample.GestureType == GestureType.DragComplete) { // calc velocity based on delta between first and last // gesture samples if (null != firstSample) { Vector2 delta = prevSample.Value.Position - firstSample.Value.Position; Catapult.ShotVelocity = MinShotStrength + Catapult.ShotStrength * (MaxShotStrength - MinShotStrength); Catapult.Fire(Catapult.ShotVelocity); Catapult.CurrentState = CatapultState.Firing; } // turn off dragging state ResetDragState(); } } }
public void AttackWithCatapult() { Debug.Log("Used Attack with catapult"); catapult.Fire(); canAttack = false; }
public void AttackWithCatapult() { catapult.Fire(); }
public void AttackWithCatapult() { catapult.Fire(); Debug.Log("Used Attack with catapult"); }