Convert CrateEffect to world coordinates.

This commit is contained in:
Paul Chote
2013-05-16 01:17:54 +12:00
parent 4d8dd2db7d
commit e122797a68
2 changed files with 2 additions and 10 deletions

View File

@@ -19,13 +19,6 @@ namespace OpenRA.Mods.RA.Effects
{
Actor a;
Animation anim = new Animation("crate-effects");
float2 offset = new float2(-4,0);
public CrateEffect(Actor a, string seq, int2 offset)
: this(a, seq)
{
this.offset = offset;
}
public CrateEffect(Actor a, string seq)
{
@@ -43,8 +36,7 @@ namespace OpenRA.Mods.RA.Effects
{
if (a.IsInWorld)
yield return new SpriteRenderable(anim.Image,
a.CenterLocation.ToFloat2() + offset,
wr.Palette("effect"), (int)a.CenterLocation.Y);
a.CenterPosition, 0, wr.Palette("effect"), 1f);
}
}
}

View File

@@ -79,7 +79,7 @@ namespace OpenRA.Mods.RA
{
Level++;
Sound.PlayNotification(self.Owner, "Sounds", "LevelUp", self.Owner.Country.Race);
self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup", new int2(0,-24))));
self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup")));
}
}