Nahquin wrote...
yepp still wall just diferent number: Wall@45065
public void End(){
addObject(new End(),31/2, 31/2);
showText("Megevett almák: "+ (a-1),13,10);
showText("Lépések: "+ (l),12,12);
addObject(new Restart(),15, 19);
}public void wall(){
int[] f =new int[]{31,0,0,31,30,0};
for (int i=0; i<f.length; i=i+3){
f_falak(f[i],f[i+1],f[i+2]);
}
int [] v = new int[]{31,0,0,31,0,30};
for (int i=0; i<v.length; i=i+3){
v_falak(v[i],v[i+1],v[i+2]);
}
}
public void f_falak(int n, int x, int y){
for(int i=0; i<n; i++){
Wall kocka= new Wall();
addObject(kocka,x,i+y);
}
}
public void v_falak(int n, int x, int y){
for(int i=0; i<n; i++){
Wall kocka= new Wall();
addObject(kocka,i+x,y);
}
}public void kocc_wall(){
Actor w = getOneIntersectingObject(Wall.class);
if (w != null){
SnakeW W = (SnakeW)getWorld();
W.End();
kocc=true;
}
}public SnakeW()
{
super(31, 31, 25);
wall();
addObject(new Snake(),15,15);
//addObject(new Animation(),15,15);
Alma();
}public void newSize(int x)
{// a hívó objektum méretét kicsinyíti x-edére
GreenfootImage myImage = getImage();
myImage.scale(myImage.getWidth() / x, myImage.getHeight() / x);
setImage(myImage);
} if (w != null && ! kocc) {