private void ShootBuilder() { if (CheckCurrentShot()) { //only allow for growification when it get's higher than 128. if (CurrentShot.Location.Y < gstate.GameArea.Height - 128) { CurrentShot.ExpandPhase(); lastshot = DateTime.Now; } } //shoot a BuilderShot. if (DateTime.Now - lastshot > cooldown) { if (!CheckCurrentShot()) { BuilderShot shootthis = new BuilderShot(ownerpaddle.Getrect().CenterPoint(), new PointF(0, -2), BlockBuildType); gstate.GameObjects.AddLast(shootthis); CurrentShot = shootthis; } } }
/// <summary> /// determines if there is a shot being... er... shot. /// </summary> /// <returns></returns> private bool CheckCurrentShot() { if (CurrentShot == null) return false; if (CurrentShot.ShotState != BuilderShot.BuilderShotState.BSS_Projectile) CurrentShot = null; return CurrentShot != null; }