public void checkCollision(CollisionSprite sprite) { if (sprite.checkCollision(sprite, boundaryBox)) { checkPlayerState(); } }
public bool checkCollision(CollisionSprite s1, CollisionSprite s2) { if (s1.getPosX() - (s1.getWidth() / 2) < s2.getPosX() + (s2.getWidth() / 2) && s1.getPosX() + (s1.getWidth() / 2) > s2.getPosX() - (s2.getWidth() / 2)) { if (s1.getPosY() - (s1.getHeight() / 2) < s2.getPosY() + (s2.getHeight() / 2) && s1.getPosY() + (s1.getHeight() / 2) > s2.getPosY() - (s2.getHeight() / 2)) { return(true); } } return(false); }
public override ObjectController acceptGameObjectVisit(CollisionSprite visitor) { GameObjectTree columnTemp = activeColumns; if (this.acceptGridVisit(visitor)) { return(gameObject); } return(null); }
public ProxyCollisionSprite(Azul.Color color, SpriteEnum name, Index index) : base() { Debug.Assert(color != null); //Debug.Assert(name.Equals(SpriteEnum.Collision)); //Debug.Assert(index.Equals(Index.Index_Null)); setBase(name, index, 0.0f, 0.0f); colSprite = CollisionSpriteManager.find(SpriteEnum.Collision, Index.Index_Null); grid = new Azul.Rect(); gridColor = color; }
public void addCollisionTest(CollisionSprite col) { if (headCollisionTests == null) { headCollisionTests = new WallCollisionData(col); } else { CLink temp = new WallCollisionData(col); temp.next = headCollisionTests; headCollisionTests = temp; } }
public override ObjectController acceptGameObjectVisit(CollisionSprite visitor) { GameObjectTree columnTemp = activeColumns; while (columnTemp != null) { if (columnTemp.acceptGridVisit(visitor)) { return(columnTemp.acceptGameObjectVisit(visitor)); } } return(null); }
public bool checkCollision(CollisionSprite sprite) { CLink temp = headCollisionTests; while (temp != null) { if (sprite.checkCollision(sprite, ((WallCollisionData)temp).getCol())) { return(true); } temp = temp.next; } return(false); }
public Projectile createEnemyProjectile() { GameObject temp = GameObjectFactory.createGameObject(); CollisionSprite sprite = ProxySpriteCollisionFactory.proxy; sprite.setScale(SizeFactory.getFactory.enemyP.colWidth, SizeFactory.getFactory.enemyP.colHeight); Sprite s = ProxySpriteFactory.makeProxySprite(SpriteType.EnemyProjectile); s.setScale(SizeFactory.getFactory.enemyP.spriteWidth, SizeFactory.getFactory.enemyP.spriteHeight); temp.setCollisionSprite(sprite); spriteManager.createActive(s); temp.setSprite(s); return(new Projectile(temp, MovementStateFactory.down)); }
public void addCol(CollisionSprite col) { colManager.createActive(col); }
public ProxyCollisionSprite(CollisionSprite sprite) { this.collisionBox = sprite; setScale(1, 1); //collisionBox = new Azul.SpriteBox(new Azul.Rect(0f, 0f, 0f, 0f), new Azul.Color(1.0f, 1.0f, 1.0f, 1.0f)); }
public virtual ObjectController visitObject(CollisionSprite visitor) { return(null); }
public AlienVictoryCollisionSubject(CollisionSprite colSprite, SpriteType name) : base(name) { this.colSprite = colSprite; }
public override bool acceptGridVisit(CollisionSprite visitor) { return(collisionComponent.visitGrid(visitor)); }
public WallCollisionData(CollisionSprite wall) { this.wall = wall; }
public void setCollisionSprite(CollisionSprite collisionSprite) { this.collisionSprite = collisionSprite; }
public PlayerBoundaryBoxLeft(Player player, CollisionSprite boundaryBox) : base(player, boundaryBox) { }
public PlayerBoundaryBox(Player player, CollisionSprite boundaryBox) { this.player = player; this.boundaryBox = boundaryBox; }
public virtual ObjectController acceptGameObjectVisit(CollisionSprite visitor) { return(null); }
public void createActive(CollisionSprite sprite) { AddToActive(new SpriteDataNode(sprite, spriteName)); }
public GameObjectTree() { this.collisionComponent = ProxySpriteCollisionFactory.proxy; }
public virtual bool acceptGridVisit(CollisionSprite visitor) { return(false); }
public override bool visitGrid(CollisionSprite visitor) { return(checkCollision(this, visitor)); }
public void setCollisionSprite(CollisionSprite collisionSprite) { this.gameObject.setCollisionSprite(collisionSprite); }
public virtual bool visitGrid(CollisionSprite visitor) { return(false); }