This commit is contained in:
Chris Forbes
2009-12-06 21:47:15 +13:00
parent 5382f5c627
commit 15cf93cdbc

View File

@@ -10,17 +10,12 @@ 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",
() =>
{
removed = true;
Game.world.AddFrameEndTask(w => w.Remove(this));
});
() => Game.world.AddFrameEndTask(w => w.Remove(this)));
}
public void Tick()
@@ -30,8 +25,7 @@ namespace OpenRa.Game.Effects
public IEnumerable<Tuple<Sprite, float2, int>> Render()
{
if (!removed)
yield return Tuple.New(anim.Image, pos.ToFloat2() - .5f * anim.Image.size, 0);
yield return Tuple.New(anim.Image, pos.ToFloat2() - .5f * anim.Image.size, 0);
}
}
}