private float GetAngle() { float elapsedSec = ((float)(loopTimer.GetTotalMs() - cycleStart)) / 1000; float angle = 2 * (float)Math.PI * (elapsedSec % cycleDuration) / cycleDuration; return(angle); }
public void SetRotating(float angleMin, float angleMax, float cycleDuration) { rotating = true; rotAngleMin = angleMin; rotAngleMax = angleMax; rotCycleDuration = cycleDuration * Settings.General.normalTimeUnitInMs; rotStartTime = loopTimer.GetTotalMs(); }
public WeaponModuleUnit( float frequency, float damage, MovementModule movementTemplate, SKBitmap projBitmap, Animator animatorExpl ) { shootInterval = 1000 / frequency; this.damage = damage; this.movementTemplate = movementTemplate; this.projBitmap = projBitmap; this.animatorExpl = animatorExpl; loopTimer = LoopTimer.GetInstance(); cooldownStartTime = loopTimer.GetTotalMs(); friendly = false; projectileManager = ProjectileManager.GetInstance(); //fireAudioPlayer = // Helper.LoadAudioPlayer("JetPack.media.samples.laserpew.ogg"); }
private bool IsGoingForward() { float elapsedSec = ((float)(loopTimer.GetTotalMs() - cycleStart)) / 1000; return((elapsedSec % cycleDuration) / cycleDuration < 0.5); }
private BackAndForthMovUnit() { loopTimer = LoopTimer.GetInstance(); cycleStart = loopTimer.GetTotalMs(); }
public void Start() { on = true; animationStartTime = loopTimer.GetTotalMs(); }
public void Explode() { exploded = true; explStart = loopTimer.GetTotalMs(); }
private CircularMovUnit() { loopTimer = LoopTimer.GetInstance(); cycleStart = loopTimer.GetTotalMs(); }