public Solid(int X, int Y, int W, int H) : base(PlatformerLevel.GAMEPLAY_LAYER) { this.X = X; this.Y = Y; Collider = new Hitbox(W, H); Tag(GameTags.Solid); }
public PlatformerObject(Vector2 Position, Vector2 size) : base(PlatformerLevel.GAMEPLAY_LAYER) { this.Position = Position; Collider = new Hitbox(size.X, size.Y,-size.X/2,-size.Y/2); Speed = new Vector2(); MaxSpeed = new Vector2(5); AirDamping = new Vector2(0.98f, 1); GroundDamping = new Vector2(0.9f, 1); }
private void modHitboxRender(On.Monocle.Hitbox.orig_Render orig, Monocle.Hitbox self, Monocle.Camera camera, Color color) { if (Settings.Enabled && Settings.DebugHitboxes) { DisplayBounds(self, (int)(self.AbsoluteX - 1), (int)(self.AbsoluteY - 1), (int)(self.Width + 3), (int)(self.Height + 3), color); } else { orig(self, camera, color); } }
protected void addBunnies(int count) { for (int i = 0; i < count; i++) { Bunny b = Scene.CreateAndAdd<Bunny>(); b.speedX = (float)rnd.NextDouble() * 5; b.speedY = (float)rnd.NextDouble() * 5 - 2.5f; b.Add (new Image (image)); Hitbox hb = new Hitbox(image.Width, image.Height, 0, 0); b.Collider = hb; bunnies.Add(b); } bunniesCount += count; }
public abstract bool Collide(Hitbox hitbox);
public override bool Collide(Hitbox hitbox) { return(Collide(hitbox.Bounds)); }
public override bool Collide(Hitbox hitbox) { return hitbox.Collide(this); }
public override bool Collide(Hitbox hitbox) { return Intersects(hitbox); }
public bool Intersects(Hitbox hitbox) { return AbsoluteLeft < hitbox.AbsoluteRight && AbsoluteRight > hitbox.AbsoluteLeft && AbsoluteBottom > hitbox.AbsoluteTop && AbsoluteTop < hitbox.AbsoluteBottom; }
public bool Intersects(Hitbox hitbox) { return(AbsoluteLeft < hitbox.AbsoluteRight && AbsoluteRight > hitbox.AbsoluteLeft && AbsoluteBottom > hitbox.AbsoluteTop && AbsoluteTop < hitbox.AbsoluteBottom); }
public override bool Collide(Hitbox hitbox) { return(Intersects(hitbox)); }
public override bool Collide(Hitbox hitbox) { foreach (var c in colliders) if (c.Collide(hitbox)) return true; return false; }
public override bool Collide(Hitbox hitbox) { return(hitbox.Collide(this)); }
public override bool Collide(Hitbox hitbox) { return Collide(hitbox.Bounds); }