예제 #1
0
파일: Solid.cs 프로젝트: saint11/oldskull
        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);
        }
예제 #2
0
 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);
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 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;
 }
예제 #5
0
 public abstract bool Collide(Hitbox hitbox);
예제 #6
0
 public abstract bool Collide(Hitbox hitbox);
예제 #7
0
 public override bool Collide(Hitbox hitbox)
 {
     return(Collide(hitbox.Bounds));
 }
예제 #8
0
파일: Grid.cs 프로젝트: saint11/oldskull
 public override bool Collide(Hitbox hitbox)
 {
     return hitbox.Collide(this);
 }
예제 #9
0
파일: Hitbox.cs 프로젝트: saint11/oldskull
 public override bool Collide(Hitbox hitbox)
 {
     return Intersects(hitbox);
 }
예제 #10
0
파일: Hitbox.cs 프로젝트: saint11/oldskull
 public bool Intersects(Hitbox hitbox)
 {
     return AbsoluteLeft < hitbox.AbsoluteRight && AbsoluteRight > hitbox.AbsoluteLeft && AbsoluteBottom > hitbox.AbsoluteTop && AbsoluteTop < hitbox.AbsoluteBottom;
 }
예제 #11
0
 public bool Intersects(Hitbox hitbox)
 {
     return(AbsoluteLeft < hitbox.AbsoluteRight && AbsoluteRight > hitbox.AbsoluteLeft && AbsoluteBottom > hitbox.AbsoluteTop && AbsoluteTop < hitbox.AbsoluteBottom);
 }
예제 #12
0
 public override bool Collide(Hitbox hitbox)
 {
     return(Intersects(hitbox));
 }
예제 #13
0
        public override bool Collide(Hitbox hitbox)
        {
            foreach (var c in colliders)
                if (c.Collide(hitbox))
                    return true;

            return false;
        }
예제 #14
0
 public override bool Collide(Hitbox hitbox)
 {
     return(hitbox.Collide(this));
 }
예제 #15
0
 public override bool Collide(Hitbox hitbox)
 {
     return Collide(hitbox.Bounds);
 }