/// <summary> /// Constructor /// </summary> /// <param name="hand">True for left hand image, false for right.</param> public Fist(bool hand, Player parent) { ForceMultiplier = DEFAULT_PUNCH_MULT; forceVector = new Vector2f(); backHand = hand; this.parent = parent; punchy = false; Punching = false; canPunch = true; Layer = ObjectLayers.JustAbove(ObjectLayers.Players); Image = new Image(Library.GetTexture("glove" + (backHand ? "2" : "1") + ".png")); Image.CenterOO(); AddComponent(Image); SetHitboxTo(Image); CenterOrigin(); Type = Collision; if (backHand) { offsetY = BackOffsetY; } else { offsetY = FrontOffsetY; } FaceRight(); }
public void NodeHandler(System.Xml.XmlNode entity) { myImage = new Image(Library.GetTexture("pivot.png")); razorArm = new Image(Library.GetTexture("razorArm.png")); razorArm.ScaleX = distance * 32 / razorArm.Width; myImage.CenterOO(); razorArm.OriginY = razorArm.Height / 2; theRazor = new RazorBlade(size); theRazor.X = X; theRazor.Y = Y; Layer = ObjectLayers.JustAbove(ObjectLayers.Players); theRazor.Layer = ObjectLayers.JustAbove(Layer); theRazor.X += razorArm.ScaledWidth; rotation = -90; speed *= 0.5f; AddComponent(razorArm); AddComponent(myImage); SetHitbox((int)(myImage.Width), (int)(myImage.Height), (int)(myImage.X + myImage.Width / 2), (int)(myImage.Y + myImage.Height / 2)); }
public GlobalEmitter() { AddResponse(Message.GroundSmash, DelegateEmit(InitGroundSmash())); AddResponse(Message.BulletTrail, DelegateEmit(InitBulletTrail())); AddResponse(Message.SuperSpeed, DelegateEmit(InitSpeed())); AddResponse(Message.DoubleJump, DelegateEmit(InitDoubleJump())); Layer = ObjectLayers.JustAbove(ObjectLayers.Players); }
public DrawEnding() { 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 text = AddComponent(new Text("Draw!")); text.Font = Library.GetFont("fonts/Laffayette_Comic_Pro.ttf"); text.Italicized = true; text.Y = -(FP.Height / 4); text.Size = 64; text.CenterOrigin(); }
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 override void Added() { base.Added(); Layer = ObjectLayers.JustAbove(ObjectLayers.Players); }