mardi 15 novembre 2016

Drag And Drop Alphabet Game [closed]

I'm student, I and my partner have to create app for kids for my project. I was assigned to make a game (Flash AS3). What code I need to use for this game. I try many code but not working.

Another O is not working, what should I do..? And can I know what code use for check the answers..?

Is anyone able to help me with the AS3 I would need to achieve this? Many thanks.

This is screenshot flash AS3 game

var oHurufInitX:Number = oHuruf_mc.x;
var oHurufInitY:Number = oHuruf_mc.y;
var bHurufInitX:Number = bHuruf_mc.x;
var bHurufInitY:Number = bHuruf_mc.y;
var kHurufInitX:Number = kHuruf_mc.x;
var kHurufInitY:Number = kHuruf_mc.y;

reset_btn.addEventListener(MouseEvent.CLICK, resetObject);

function resetObject(e:MouseEvent):void
{
     oHuruf_mc.x = oHurufInitX;
     oHuruf_mc.y = oHurufInitY;
     bHuruf_mc.x = bHurufInitX;
     bHuruf_mc.y = bHurufInitY;
     kHuruf_mc.x = kHurufInitX;
     kHuruf_mc.y = kHurufInitY;
}


/*check_btn.addeventListener(MouseEvent.CLICK, checkObject);

function checkObject(e:MouseEvent):void
    {
     if (check = "right") {
         response_txt.text = "Good Job!";
     }
     else {
         response_txt.text = "Try Again";
     }
}*/


oHuruf_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart1);
function dragStart1(event: MouseEvent):void {
    oHuruf_mc.startDrag();
}

oHuruf_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop1);
function dragStop1(event: MouseEvent):void {
    oHuruf_mc.stopDrag();
    if (oHuruf_mc.hitTestObject(target1_mc)==true){
         //trace("hit");
         oHuruf_mc.x=target1_mc.x;
         oHuruf_mc.y=target1_mc.y;
       }
}

bHuruf_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart2);
function dragStart2(event: MouseEvent):void {
    bHuruf_mc.startDrag();
}

bHuruf_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop2);
function dragStop2(event: MouseEvent):void {
    bHuruf_mc.stopDrag();
    if (bHuruf_mc.hitTestObject(target2_mc)==true){
            bHuruf_mc.x=target2_mc.x;
            bHuruf_mc.y=target2_mc.y;
          }
}

kHuruf_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart3);
function dragStart3(event: MouseEvent):void {
    kHuruf_mc.startDrag();
}

kHuruf_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop3);
function dragStop3(event: MouseEvent):void {
    kHuruf_mc.stopDrag();
    if (kHuruf_mc.hitTestObject(target3_mc)==true){
            kHuruf_mc.x=target3_mc.x;
            kHuruf_mc.y=target3_mc.y;
          }
}

Aucun commentaire:

Enregistrer un commentaire