var hiz:Number = 1;
var ivme:Number = 0.1;
var x1,x2:Number;
stage.addEventListener(Event.ENTER_FRAME,dusmefonk);
stage.addEventListener(MouseEvent.CLICK,Kontrol);
function dusmefonk(event:Event):void
{
topmc.y += hiz + ivme;
hiz += ivme;
topmc.x += 1;
if (topmc.hitTestObject(engelmc))
{
sonlandir();
}
if (topmc.hitTestObject(engel2mc))
{
sonlandir();
}
if (topmc.x >= 550)
{
topmc.x = 0;
x1=engel2mc.x;
x2=engelmc.x;
engel2mc.x=x2;
engelmc.x=x1;
}
}
function sonlandir():void
{
stage.removeEventListener(MouseEvent.CLICK,Kontrol);
topmc.rotation = -180;
}
function Kontrol(event:Event):void
{
hiz = 1;
ivme = 0.1;
topmc.y -=5*(hiz+hiz+ivme);
}
Hiç yorum yok :
Yorum Gönder