Convert GpsSatellite to world coordinates.
This commit is contained in:
@@ -19,15 +19,15 @@ namespace OpenRA.Mods.RA.Effects
|
||||
{
|
||||
int frame = 0;
|
||||
Animation doors = new Animation("atek");
|
||||
float2 doorOffset = new float2(-4,0);
|
||||
float2 pos;
|
||||
float2 doorOrigin = new float2(16,24);
|
||||
WPos pos;
|
||||
|
||||
public SatelliteLaunch(Actor a)
|
||||
{
|
||||
doors.PlayThen("active",
|
||||
() => a.World.AddFrameEndTask(w => w.Remove(this)));
|
||||
|
||||
pos = a.CenterLocation.ToFloat2() + doorOffset;
|
||||
pos = a.CenterPosition;
|
||||
}
|
||||
|
||||
public void Tick( World world )
|
||||
@@ -35,14 +35,12 @@ namespace OpenRA.Mods.RA.Effects
|
||||
doors.Tick();
|
||||
|
||||
if (++frame == 19)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new GpsSatellite(pos)));
|
||||
}
|
||||
world.AddFrameEndTask(w => w.Add(new GpsSatellite(pos, doorOrigin)));
|
||||
}
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
yield return new SpriteRenderable(doors.Image, pos, wr.Palette("effect"), (int)doorOffset.Y);
|
||||
yield return new SpriteRenderable(doors.Image, pos, 0, wr.Palette("effect"), 1f, doorOrigin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user