2010-12-28 22:09:00
genie1215
12/28ac上課資料(2)打怪獸
var romioList:Array = new Array();
for(var i:int = 0;i<8;i++){
var romio:mt = new mt
if(i<4){
romio.y = 70
romio.x = 100+100*i
}else{
romio.y = 150
romio.x =50+100*(i-4)
}
this.addChild(romio)
romioList.push(romio)
}
//鍵盤操控車子
stage.addEventListener(KeyboardEvent.KEY_DOWN,dokey)
function dokey(e:KeyboardEvent):void{
switch(e.keyCode){
case 37:
if(car.x>10){
car.x -=10}
break;
case 39:
if(car.x<520){
car.x+=10
}
break;
case 32:
bu.x =car.x
bu.y =car.y
addChild(bu)
setInterval(aa,50)
}
}
//
var bu:bulet = new bulet
//
function aa(){
if(bu.y>20){
bu.y-=5;
for(var i:int = 0;i
for(var i:int = 0;i<8;i++){
var romio:mt = new mt
if(i<4){
romio.y = 70
romio.x = 100+100*i
}else{
romio.y = 150
romio.x =50+100*(i-4)
}
this.addChild(romio)
romioList.push(romio)
}
//鍵盤操控車子
stage.addEventListener(KeyboardEvent.KEY_DOWN,dokey)
function dokey(e:KeyboardEvent):void{
switch(e.keyCode){
case 37:
if(car.x>10){
car.x -=10}
break;
case 39:
if(car.x<520){
car.x+=10
}
break;
case 32:
bu.x =car.x
bu.y =car.y
addChild(bu)
setInterval(aa,50)
}
}
//
var bu:bulet = new bulet
//
function aa(){
if(bu.y>20){
bu.y-=5;
for(var i:int = 0;i
上一篇:12/28ac上課資料(1)