private void FixedUpdate() { if (spawnGroupsSinceLastDeadTime < spawnGroupsPerDeadTime) { if (spawnGroupActive) { while (timerSpawn.TimeUp(ts.DeltaTime())) { ChooseRandomSpawnPosition(); SpawnEnemy(); } } else { while (timerSpawnGroup.TimeUp(ts.DeltaTime())) { challengeCurrent = 0.0f; challengeMax += challengeIncreasePerSpawnGroup; spawnGroupActive = true; //ChooseRandomSpawnPosition(); spawnGroupsSinceLastDeadTime += 1; } } } else { while (timerDeadTime.TimeUp(ts.DeltaTime())) { spawnGroupsSinceLastDeadTime = 0; } } }
private void FixedUpdate() { float xDifference = oscX.SampleDelta(timeScale.DeltaTime()); float yDifference = oscY.SampleDelta(timeScale.DeltaTime()); Vector2 change = new Vector2(xDifference, yDifference); mover.OffsetPosition(change); }
private void FixedUpdate() { secondsPassed += ts.DeltaTime(); while (timerPointsPerSecond.TimeUp(ts.DeltaTime())) { textScore.AddValue(pointsPerSecondPlaying); } }
private void FixedUpdate() { while (timerBattleAxe.TimeUp(ts.DeltaTime())) { playerPunch.UseBattleAxe(false); SetPowerupExists(false); } while (timerMoreArms.TimeUp(ts.DeltaTime())) { playerPunch.UseMoreArms(false); SetPowerupExists(false); } }
private void FixedUpdate() { meterPunchCooldown.SetPercent(timerPunchCooldown.GetPercentFinished()); while (timerPunching.TimeUp(ts.DeltaTime())) { // Punch finished. punchingObject.SetActive(false); timerPunchCooldown.Start(); } while (timerPunchCooldown.TimeUp(ts.DeltaTime())) { // Punch cooldown finished. } }
private void FixedUpdate() { float dt = ts.DeltaTime(); while (timerHesitate.TimeUp(dt)) { timerFinished = true; } if (timerFinished) { // Shrink the buffer. float stepSize = dt * shrinkSpeed; if (shrinkToLeft) { bufferUpper = UtilMath.Approach(bufferUpper, bufferLower, stepSize); } else { bufferLower = UtilMath.Approach(bufferLower, bufferUpper, stepSize); } UpdateBufferMeter(); if (bufferLower == bufferUpper) { timerFinished = false; } } }
private void FixedUpdate() { Vector2 velocity = vius.GetVelocity(); velocity.y -= acceleration * gravityScale * timeScale.DeltaTime(); vius.SetVelocity(velocity); }
private void FixedUpdate() { float dt = timeScale.DeltaTime(); if (velocity != Vector2.zero) { mover.TeleportPosition( UtilApproach.Vector2D(mover.GetPosition(), target, velocity * dt)); if (mover.GetPosition() == target) { // The object has reached its destination. // Do different things depending on the current state. if (state == State.Rise) { state = State.Idle; timerIdle.Run(); } else if (state == State.Lower) { Destroy(gameObject); } } } timerWarning.Tick(dt); timerIdle.Tick(dt); }
private void FixedUpdate() { Vector2 velocity = rb.velocity; velocity += upDirection.GetDownVector() * acceleration * gravityScale * timeScale.DeltaTime(); rb.velocity = velocity; }
private void FixedUpdate() { float dt = timeScale.DeltaTime(); foreach (AttackGroup attackGroup in data.attackGroups) { attackGroup.Tick(dt); } }
private void FixedUpdate() { if (spawnGroupsSinceLastDeadTime < spawnGroupsPerDeadTime) { if (spawnGroupActive) { timerSpawn.Tick(timeScale.DeltaTime()); } else { timerSpawnGroup.Tick(timeScale.DeltaTime()); } } else { timerDeadTime.Tick(timeScale.DeltaTime()); } }
private void FixedUpdate() { Vector3 euler = transform.eulerAngles; euler.z = Angle.FromDegrees(euler.z).ApproachCoterminal( upDirection.GetUpAngle().AddDegrees(-90.0f), rotationSpeed * timeScale.DeltaTime()) .GetDegrees(); transform.rotation = Quaternion.Euler(euler); }
private void UpdateCurrentDegreesHeading() { mover.TeleportRotation(mover.GetRotation().Approach( angleTarget, angleChangePerSecond * timeScale.DeltaTime())); /* * UtilApproach.AngleDegrees(mover.GetRotation(), * targetDegrees, degreeChangePerSecond * timeScale.DeltaTime())); */ }
private void FixedUpdate() { timerHesitate.Tick(timeScale.DeltaTime()); if (timerFinished) { // Shrink the buffer. float stepSize = timeScale.DeltaTime() * shrinkSpeed; if (shrinkToLeft) { bufferUpper = UtilMath.Approach(bufferUpper, bufferLower, stepSize); } else { bufferLower = UtilMath.Approach(bufferLower, bufferUpper, stepSize); } UpdateBufferMeter(); if (bufferLower == bufferUpper) { timerFinished = false; } } }
private void FixedUpdate() { Vector3 euler = transform.eulerAngles; euler.z = Angle.FromDegrees(euler.z).Approach( upDirection.GetUpAngle().AddDegrees(-90.0f), Angle.FromDegrees(rotationSpeed * timeScale.DeltaTime())) .GetDegrees(); //UtilPeriodic.Approach() /* * UtilApproach.AngleDegrees(euler.z, * upDirection.GetUpAngle() - 90.0f, rotationSpeed * timeScale.DeltaTime()); */ transform.rotation = Quaternion.Euler(euler); }
private void FixedUpdate() { if (lerping) { Vector2 stepVelocity = velocity * timeScale.DeltaTime(); if (stepVelocity.sqrMagnitude > (destination - mover.GetPosition()).sqrMagnitude) { mover.TeleportPosition(destination); OnCompleted(); } else { mover.OffsetPosition(stepVelocity); } } }
public void ReceiveInput(InputReader inputReader) { float axisH = inputReader.GetAxisHorizontalRaw(); float axisV = inputReader.GetAxisVerticalRaw(); Vector2 change = new Vector2(axisH, axisV) * data.movementSpeed * tsGameplay.DeltaTime(); mover.OffsetPosition(change); if (!tsGameplay.IsPaused()) { if (inputReader.GetKeyDown(KeyCode.Space)) { playerPunch.Punch(); } } if (inputReader.GetKeyDown(KeyCode.Escape)) { TogglePause(); } }
private void FixedUpdate() { Vector2 velocity = vius.GetVelocity(); float dt = timeScale.DeltaTime(); // Decelerate if the Rigidbody is grounded and not accelerating. if (groundChecker.IsOnGround() && accumulatedHorizontalAcceleration == 0.0f) { velocity.x = UtilApproach.Float(velocity.x, 0.0f, groundDeceleration * dt); } // Accelerate the Rigidbody based on applied forces. velocity.x += accumulatedHorizontalAcceleration * dt; accumulatedHorizontalAcceleration = 0.0f; // Cap the Rigidbody's velocity. if (Mathf.Abs(velocity.x) > maxHorizontalSpeed) { velocity.x = Mathf.Sign(velocity.x) * maxHorizontalSpeed; } vius.SetVelocity(velocity); }
private void FixedUpdate() { timerItemText.Tick(timeScale.DeltaTime()); }
private void FixedUpdate() { secondsPassed += ts.DeltaTime(); timerPointsPerSecond.Tick(ts.DeltaTime()); }
private void FixedUpdate() { // Update the GameObject's angle. mover.TeleportRotation(mover.GetRotation().ApproachCoterminal( angleTarget, angleChangePerSecond * timeScale.DeltaTime())); }
private void FixedUpdate() { Vector3 euler = transform.eulerAngles; euler.z = UtilMath.ApproachAngleDegrees(euler.z, upDirection.GetUpAngle() - 90.0f, rotationSpeed * timeScale.DeltaTime()); transform.rotation = Quaternion.Euler(euler); }
private void FixedUpdate() { timerVolley.Tick(timeScale.DeltaTime()); }
private void FixedUpdate() { float difference = osc.SampleDelta(timeScale.DeltaTime()); accessor.Set(accessor.Get() + difference); }
private void FixedUpdate() { float difference = osc.SampleDelta(timeScale.DeltaTime()); timeRegion.SetFactor(timeRegion.GetFactor() + difference); }
private void FixedUpdate() { timerTongue.Tick(timeScale.DeltaTime()); }
private void FixedUpdate() { timerBattleAxe.Tick(ts.DeltaTime()); timerMoreArms.Tick(ts.DeltaTime()); }
private void FixedUpdate() { timerRestart.Tick(timeScale.DeltaTime()); }
private void FixedUpdate() { timerColor.Tick(timeScale.DeltaTime()); }
private void FixedUpdate() { mover.OffsetPosition(velocity * timeScale.DeltaTime()); }