public FutilePlatformerBaseObject(RXRect hitBox, World world, string shadow ="")
    {
        this.ySetsSortZ = true;
        this.hitBox = hitBox;
        this.world = world;
        this.tileSize = world.TileSize;

        if (C.isDebug)
        {
            collisionDebugSprite = new FSprite("boundingBox");
            collisionDebugSprite.x = hitBox.x;
            collisionDebugSprite.y = hitBox.y;
            collisionDebugSprite.width = hitBox.width;
            collisionDebugSprite.height = hitBox.height;
            collisionDebugSprite.sortZ = 100;
            this.AddChild(collisionDebugSprite);
        }

            this.shouldSortByZ = true;
        if (!String.IsNullOrEmpty(shadow))
        {
            this.shadow = new FSprite(shadow);
            this.shadow.y = -.1f;
            this.AddChild(this.shadow);
        }

        UpdateCollisionChecks();
    }
Exemple #2
0
 public RXRect Clone()
 {
     RXRect rect = new RXRect();
     rect.x = x;
     rect.y = y;
     rect.width = width;
     rect.height = height;
     return rect;
 }
Exemple #3
0
    public RXRect Clone()
    {
        RXRect rect = new RXRect();

        rect.x      = x;
        rect.y      = y;
        rect.width  = width;
        rect.height = height;
        return(rect);
    }
Exemple #4
0
 public bool CheckIntersect(RXRect otherRect)
 {
     return
         (
         ((this.x + this.width) >= otherRect.x) &&
         (this.x <= (otherRect.x + otherRect.width)) &&
         ((this.y + this.height) >= otherRect.y) &&
         (this.y <= (otherRect.y + otherRect.height))
         );
 }
Exemple #5
0
	public bool CheckIntersect(RXRect otherRect)
	{
		return 
		(
			((this.x+this.width) >= otherRect.x) && 
			(this.x <= (otherRect.x+otherRect.width)) && 
			((this.y+this.height) >= otherRect.y) && 
			(this.y <= (otherRect.y+otherRect.height))
		);
	}
    public FutilePlatformerBaseObject(RXRect hitBox, World world)
    {
        this.hitBox = hitBox;
        this.world = world;
        this.tileSize = world.TileSize;

        if (C.isDebug)
        {
            collisionDebugSprite = new FSprite("boundingBox");
            collisionDebugSprite.x = hitBox.x;
            collisionDebugSprite.y = hitBox.y;
            collisionDebugSprite.width = hitBox.width;
            collisionDebugSprite.height = hitBox.height;
            collisionDebugSprite.sortZ = 100;
            this.shouldSortByZ = true;
            this.AddChild(collisionDebugSprite);
        }

        UpdateCollisionChecks();
    }
 public FutileFourDirectionBaseObject(RXRect hitBox, World world, string shadow = "")
     : base(hitBox, world, shadow)
 {
 }
 public FutileFourDirectionBaseObject(RXRect hitBox, World world)
     : base(hitBox, world)
 {
 }