// If Player is like a ghost and plan into non EmptyBlock it stops expanding
if (blocks.getBlock(xR, yR) instanceof BrickBlock)
{
blocks.setBlock(BlockFactory.createElement(GameBlock.EMPTY), xR, yR);
Entity blen = EntityFactory.createEntity(GameEntities.DESTROYING_BRICK, xR, yR);
map.addEnemy(blen);
return;
}
/*
* Makes cross of enemy explosion entities
* Stops on non EmptyBlock
*/
for (int i = 0; i < 4; ++i)
{
x = xR;
y = yR;
destroyedBrickAnimation:
for (int j = 1; j <= b.getArea(); ++j)
{
/*
* Way to 'recurse'
*/
switch (i)
{
case 0: x = xR; y = yR - j; break;
case 1: x = xR; y = yR + j; break;
case 2: x = xR - j; y = yR; break;
case 3: x = xR + j; y = yR; break;
}
if (blocks.getBlock(x, y) instanceof StoneBlock)
{
break;
}
else if (blocks.getBlock(x, y) instanceof BrickBlock)
{
Entity blen = EntityFactory.createEntity(GameEntities.DESTROYING_BRICK, x, y);
blocks.setBlock(BlockFactory.createElement(GameBlock.EMPTY), x, y);
map.addEnemy(blen);
break;
}
else if (blocks.getBlock(x, y) instanceof EmptyBlock)
{
Entity blen = EntityFactory.createEntity(GameEntities.EXPLOSION, x, y);
/*
* Stops on brick which is dying
*/
for (Entity e : map.getEntities())