g.drawImage(grass, j, i, null);
}
}
for (int i = 0; i < model.getObstacles().size(); i++) {
Obstacle p = model.getObstacles().get(i);
if (p instanceof SpikePit) {// for instance of SpikePit
SpikePit sp = (SpikePit) p;
SpikePitRectangle spRect = sp.getRectangle();
g.drawImage(spRect.getImage(), spRect.xCoord(),
spRect.yCoord(), null);
}
if (p instanceof Crate) {// for instance of crate
Crate c = (Crate) p;
CrateRectangle cRect = c.getRectangle();
g.drawImage(cRect.getImage(), cRect.xCoord(), cRect.yCoord(),
null);
}
if (p instanceof ImmovableBlock) {// for instance of immovableBlock
ImmovableBlock ib = (ImmovableBlock) p;
ImmovableBlockRectangle ibRect = ib.getRectangle();
g.drawImage(ibRect.getImage(), ibRect.xCoord(),
ibRect.yCoord(), null);
}
if(p instanceof FireRing) {
FireRing fr = (FireRing)p;
FireRingRectangle rect = fr.getRectangle();
g.drawImage(fr.getImage(), rect.xCoord(),
rect.yCoord(), null);
}
if (p instanceof TNT) {// for instance of TNT
TNT tnt = (TNT) p;
TNTRectangle tntRect = tnt.getRectangle();
g.drawImage(tntRect.getImage(), tntRect.xCoord(),
tntRect.yCoord(), null);
}
}
for (PlayerTank p : tankList) {
TankRectangle tRect = p.getRectangle();
g.drawImage(p.getImage(), tRect.xCoord(), tRect.yCoord(), null);
}
for (EnemyTank p : enemyList) {
TankRectangle tRect = p.getRectangle();
g.drawImage(p.getImage(), tRect.xCoord(), tRect.yCoord(), null);
}
for (Projectile p : projectileList) {
if (p instanceof PlayerProjectile) {
PlayerProjectile s = (PlayerProjectile) p;