This commit is contained in:
Chris Forbes
2009-12-06 21:23:13 +13:00
parent 3d457c397d
commit 8973690c62
2 changed files with 9 additions and 4 deletions

View File

@@ -10,13 +10,17 @@ namespace OpenRa.Game.Effects
{
readonly int2 pos;
readonly Animation anim = new Animation("smokey");
bool removed;
public Smoke(int2 pos)
{
this.pos = pos;
anim.PlayThen("idle",
() => Game.world.AddFrameEndTask(
w => w.Remove(this)));
() =>
{
removed = true;
Game.world.AddFrameEndTask(w => w.Remove(this));
});
}
public void Tick()
@@ -26,7 +30,8 @@ namespace OpenRa.Game.Effects
public IEnumerable<Tuple<Sprite, float2, int>> Render()
{
yield return Tuple.New(anim.Image, pos.ToFloat2() - .5f * anim.Image.size, 0);
if (!removed)
yield return Tuple.New(anim.Image, pos.ToFloat2() - .5f * anim.Image.size, 0);
}
}
}

View File

@@ -607,6 +607,6 @@
<sequence name="idle" start="0" length="32" />
</unit>
<unit name="smokey">
<sequence name="idle" start="0" length="6" />
<sequence name="idle" start="0" length="7" />
</unit>
</sequences>