I am having problems as my code is not creating my bandits on my game grid my code is below.
plz help
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
import javax.swing.*;
/**
* Write a description of class Game here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Game extends World
{
/**
* Constructor for objects of class Game.
*
*/
public Game()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(720, 480, 1);
game_background rect = new game_background();
addObject(rect,600,240);
//String inputstring = JOptionPane.showInputDialog("Your question here:");
Player P = new Player();
addObject (P,30,450);
Bandit band = new Bandit();
int z = 0;
while(z<=5){
int xc = Greenfoot.getRandomNumber(8);
int yc = Greenfoot.getRandomNumber(8);
xc = (xc*60)+30;
yc = (xc*60)+30;
if(xc == 30 && yc == 450){
addObject(band, xc+60,yc-60);
z++;
}else if(getObjectsAt( xc, yc, Bandit.class).isEmpty()) {
addObject(band, xc, yc);
z++;
}
}
}
}


