mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 16:05:53 +00:00
Danmaku system
This commit is contained in:
parent
9c8ec486fc
commit
fdec052c16
38 changed files with 924 additions and 9 deletions
42
Scripts/Resources/PatternGroup.cs
Normal file
42
Scripts/Resources/PatternGroup.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
using Cirno.Scripts.Actors;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class PatternGroup : AttackPattern
|
||||
{
|
||||
[Export] private Array<AttackPattern> patterns;
|
||||
private int currentPatternIndex = 0;
|
||||
|
||||
public override void Start(Boss boss)
|
||||
{
|
||||
Boss = boss;
|
||||
currentPatternIndex = 0;
|
||||
patterns[currentPatternIndex].Start(boss);
|
||||
}
|
||||
|
||||
public override void UpdatePattern(double delta)
|
||||
{
|
||||
if (currentPatternIndex < patterns.Count)
|
||||
{
|
||||
patterns[currentPatternIndex].UpdatePattern(delta);
|
||||
|
||||
if (!patterns[currentPatternIndex].WaitForCompletion || patterns[currentPatternIndex].IsComplete())
|
||||
{
|
||||
currentPatternIndex++;
|
||||
if (currentPatternIndex < patterns.Count)
|
||||
{
|
||||
patterns[currentPatternIndex].Start(Boss);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsComplete()
|
||||
{
|
||||
return currentPatternIndex >= patterns.Count;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue