public WithRotor(Actor self, WithRotorInfo info) { var rs = self.Trait <RenderSprites>(); var body = self.Trait <IBodyOrientation>(); rotorAnim = new Animation(rs.GetImage(self)); rotorAnim.PlayRepeating("rotor"); rs.anims.Add(info.Id, new AnimationWithOffset(rotorAnim, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), null, p => WithTurret.ZOffsetFromCenter(self, p, 1))); }
public WithRotor(Actor self, WithRotorInfo info) { var rs = self.Trait<RenderSimple>(); var facing = self.Trait<IFacing>(); rotorAnim = new Animation(rs.GetImage(self)); rotorAnim.PlayRepeating("rotor"); rs.anims.Add(info.Id, new RenderSimple.AnimationWithOffset( rotorAnim, () => Combat.GetTurretPosition( self, facing, new Turret(info.Offset)), null ) { ZOffset = 1 } ); }
public WithRotor(Actor self, WithRotorInfo info) { var rs = self.Trait <RenderSimple>(); rotorAnim = new Animation(rs.GetImage(self)); rotorAnim.PlayRepeating("rotor"); rs.anims.Add(info.Id, new AnimationWithOffset( rotorAnim, wr => wr.ScreenPxOffset(rs.LocalToWorld(info.Offset.Rotate(rs.QuantizeOrientation(self, self.Orientation)))), null) { ZOffset = 1 }); }
public WithRotor(Actor self, WithRotorInfo info) { this.info = info; var rs = self.Trait <RenderSprites>(); var body = self.Trait <IBodyOrientation>(); movement = self.Trait <IMove>(); rotorAnim = new Animation(self.World, rs.GetImage(self)); rotorAnim.PlayRepeating(info.Sequence); rs.Add(info.Id, new AnimationWithOffset(rotorAnim, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), null, () => false, p => WithTurret.ZOffsetFromCenter(self, p, 1))); }
public WithRotor(Actor self, WithRotorInfo info) { var rs = self.Trait <RenderSimple>(); var facing = self.Trait <IFacing>(); rotorAnim = new Animation(rs.GetImage(self)); rotorAnim.PlayRepeating("rotor"); rs.anims.Add(info.Id, new AnimationWithOffset( rotorAnim, () => Combat.GetTurretPosition(self, facing, new Turret(info.Offset)).ToFloat2(), null) { ZOffset = 1 }); }