示例#1
0
        private float GetAngle()
        {
            float elapsedSec = ((float)(loopTimer.GetTotalMs() - cycleStart)) / 1000;
            float angle      = 2 * (float)Math.PI * (elapsedSec % cycleDuration) / cycleDuration;

            return(angle);
        }
示例#2
0
 public void SetRotating(float angleMin, float angleMax, float cycleDuration)
 {
     rotating         = true;
     rotAngleMin      = angleMin;
     rotAngleMax      = angleMax;
     rotCycleDuration = cycleDuration * Settings.General.normalTimeUnitInMs;
     rotStartTime     = loopTimer.GetTotalMs();
 }
示例#3
0
 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");
 }
示例#4
0
        private bool IsGoingForward()
        {
            float elapsedSec = ((float)(loopTimer.GetTotalMs() - cycleStart)) / 1000;

            return((elapsedSec % cycleDuration) / cycleDuration < 0.5);
        }
示例#5
0
 private BackAndForthMovUnit()
 {
     loopTimer  = LoopTimer.GetInstance();
     cycleStart = loopTimer.GetTotalMs();
 }
示例#6
0
 public void Start()
 {
     on = true;
     animationStartTime = loopTimer.GetTotalMs();
 }
示例#7
0
文件: Enemy.cs 项目: Nige91/JetPack
 public void Explode()
 {
     exploded  = true;
     explStart = loopTimer.GetTotalMs();
 }
示例#8
0
 private CircularMovUnit()
 {
     loopTimer  = LoopTimer.GetInstance();
     cycleStart = loopTimer.GetTotalMs();
 }