extends SpriteChar; mapdata=new Array(); for (i=0;i<400 ; i++){ mapdata.add(rnd(2)); } for (i=0;i<20;i++){ for (k=0;k<20;k++){ if (mapdata.get(i*20+k)==0){ $map.set(k,i,-1); }else if (mapdata.get(i*20+k)==1){ $map.set(k,i,$pat_myimg+1); } } } while(1){ if (getkey(39)>0) scx+=3; if (getkey(37)>0) scx-=3; if (getkey(40)>0) scy+=3; if (getkey(38)>0) scy-=3; $map.scrollTo(scx,scy); update(); }