move flash

This commit is contained in:
Chris Forbes
2009-12-22 23:19:00 +13:00
parent 96728262e6
commit 6af7d83fec
4 changed files with 56 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.Graphics;
using OpenRa.Game.Traits;
namespace OpenRa.Game.Effects
{
class MoveFlash : IEffect
{
Animation anim = new Animation("moveflsh");
float2 pos;
public MoveFlash( float2 pos )
{
this.pos = pos;
anim.PlayThen( "idle",
() => Game.world.AddFrameEndTask(
w => w.Remove( this ) ) );
}
public void Tick() { anim.Tick(); }
public IEnumerable<Renderable> Render()
{
yield return new Renderable(anim.Image, pos - .5f * anim.Image.size, 0);
}
}
}