Pass Turn
This commit is contained in:
parent
4f3b502f2e
commit
c618172545
|
@ -13,6 +13,7 @@ namespace HeavenStudio.Games.Scripts_ShootEmUp
|
|||
public Animator damageAnim;
|
||||
|
||||
public bool isDamage = false;
|
||||
// int life = 24;
|
||||
|
||||
public void Shoot()
|
||||
{
|
||||
|
@ -22,6 +23,12 @@ namespace HeavenStudio.Games.Scripts_ShootEmUp
|
|||
|
||||
public void Damage()
|
||||
{
|
||||
// if (life > 0) {
|
||||
// life = Mathf.Max(life - 8, 0);
|
||||
// } else {
|
||||
// // Gameover if you miss in next interval
|
||||
// }
|
||||
|
||||
isDamage = true;
|
||||
shipAnim.Play("shipDamage", 0, 0);
|
||||
damageAnim.Play("damage", 0, 0);
|
||||
|
|
|
@ -154,7 +154,7 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
foreach (var crEvent in crHandlerInstance.queuedEvents)
|
||||
{
|
||||
SpawnEnemy(crEvent.beat, crEvent.DynamicData["pos"], false, crHandlerInstance.intervalLength);
|
||||
SpawnEnemy(crEvent.beat, crEvent.DynamicData["pos"], false, crHandlerInstance.intervalLength, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -227,13 +227,15 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
}
|
||||
|
||||
public void SpawnEnemy(double beat, Vector2 pos, bool active = true, float interval = 4f)
|
||||
public void SpawnEnemy(double beat, Vector2 pos, bool active = true, float interval = 4f, bool awake = false)
|
||||
{
|
||||
if (crHandlerInstance.queuedEvents.Count > 0 && crHandlerInstance.queuedEvents.Find(x => x.beat == beat || (beat >= x.beat && beat <= x.beat + x.length)) != null) return;
|
||||
|
||||
crHandlerInstance.AddEvent(beat, crParams: new(){
|
||||
new CallAndResponseHandler.CallAndResponseEventParam("pos", pos),
|
||||
});
|
||||
if (!awake)
|
||||
{
|
||||
if (crHandlerInstance.queuedEvents.Count > 0 && crHandlerInstance.queuedEvents.Find(x => x.beat == beat || (beat >= x.beat && beat <= x.beat + x.length)) != null) return;
|
||||
crHandlerInstance.AddEvent(beat, crParams: new(){
|
||||
new CallAndResponseHandler.CallAndResponseEventParam("pos", pos),
|
||||
});
|
||||
}
|
||||
|
||||
var newEnemy = Instantiate(baseEnemy, enemyHolder).GetComponent<Enemy>();
|
||||
spawnedEnemies.Add(newEnemy);
|
||||
|
|
Loading…
Reference in a new issue