i have this code
but when run it there is only one object in the top right of the world
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Map here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Map extends World
{
public Maps m = new Maps();
private int map[][]=
{
{1,1,1,1,1},
{1,0,0,0,1},
{1,0,0,0,1},
{1,0,0,0,1},
{1,1,1,1,1}
};
int wallss;
public Map()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(5, 5, 201, false);
Mapp mapp = new Mapp();
for( int y=0; y!=map.length; y++) for(int x=0; x!=map[y].length; x++)
{
//Actor actor = null;
switch(map [y] [x])
{
case 0: break;
case 1: objectsss(mapp,x, y); break;
}
//addObject(actor, x, y);
}
}
int x1, y1;
public void objectsss(greenfoot.Actor actor, int x, int y)
{
x1 = x;
y1 = y;
addObject(actor, x, y);
wallss ++;
}
}
