public VictoryEnding(Player winner) { Winner = winner; X = FP.Camera.X; Y = FP.Camera.Y; Layer = ObjectLayers.JustAbove(ObjectLayers.Background); var bg = AddComponent(Image.CreateRect(FP.Width, FP.Height, new Color())); bg.CenterOO(); var image = AddComponent(new Image(Library.GetTexture("happy.png"))); image.CenterOO(); // YOU WIN! var text = AddComponent(new Text("\tPlayer " + (Winner.PlayerId + 1) + "\nis the true hero!")); text.Y = -(FP.Height / 4); text.Font = Library.GetFont("fonts/Laffayette_Comic_Pro.ttf"); text.Size = 64; text.CenterOrigin(); Tweener.Tween(Winner, new { X = FP.Camera.X, Y = FP.Camera.Y }, 1.2f) .Ease(Ease.ElasticOut); HypeTween.StartHype(Tweener, image, 1); Tweener.Tween(image, new { Angle = 359 }, 20) .Repeat(); Tweener.Tween(image, new { Scale = 1.7f }, 0.7f) .From(new { Scale = 0.7f }) .Ease(Ease.SineOut) .Repeat() .Reflect(); Winner.OnMessage(PhysicsBody.Message.Deactivate); }
public HyperFist(Player owner) { var config = Library.GetConfig <HyperPunchConfig>("config/upgrades/hyperpunch.ini"); FistScale = config.Scale; ForceMultiplier = config.ForceMultiplier; FistSpeed = config.Speed; this.owner = originalOwner = owner; image = new Image(Library.GetTexture("hyperPunch.png")); image.Scale = 0.1f * this.FistScale; image.CenterOO(); AddComponent(image); SetHitbox((int)image.ScaledWidth, (int)image.ScaledHeight); CenterOrigin(); direction = new Point(); AddResponse(ChunkManager.Message.Advance, OnAdvance); HypeTween.StartHype(Tweener, image, 0.1f); }