*mycharクラス while(1) { if(getkey(39) && x<$screenwidth) { x=x+3; } if(getkey(37) && x>0) { x=x-3; } if(getkey(40) && y<$screenheight) { y=y+3; } if(getkey(38) && y>0) { y=y-3; } if (getkey(32)==1) { appear(new Tama(x,y,$pat_Sample+1)); } update(); } *tamaクラス while(y>0) { y=y-8; update(); } *ufoクラス while(1) { while(x<$screenWidth) { x=x+2; if (rnd(50)==0) { appear(new Enemy(x,y,$pat_Sample+2)); } update(); } while(x>0) { x=x-2; if (rnd(50)==0) { appear(new Enemy(x,y,$pat_Sample+2)); } update(); } } *enemyクラス extends SpriteChar; while(y<$screenheight) { y=y+2; if(crashto($mychar)) { $life--; if($life<=0) { $mychar.die(); } } update(); } *textクラス $life = 10; while(1) { text="life:" + $life; update(); }