mercredi 5 avril 2017

Am I developing a game in as3 memory?

Wanted to know how to make a memory game in as3 where you first have:

1-every time the game runs the cards are random.

2-Have at least one condition to verify that the cards are the same and if they are to disappear.

3- if the cards are not equal return to normal

4-all just with a movieclip that contains in the frames the cards

Thank you for understanding

I have this code so far:

import flash.events.MouseEvent;

//variáveis relativo ao score, pattern and so on
var pattern = new Array();
var buttons = new Array();
buttons.push(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
var position = 0;

//Dizer aos botões que esperam ser clicados pelo rato
a.addEventListener(MouseEvent.CLICK, Clicked);
b.addEventListener(MouseEvent.CLICK, Clicked);
c.addEventListener(MouseEvent.CLICK, Clicked);
d.addEventListener(MouseEvent.CLICK, Clicked);
e.addEventListener(MouseEvent.CLICK, Clicked);
f.addEventListener(MouseEvent.CLICK, Clicked);
g.addEventListener(MouseEvent.CLICK, Clicked);
h.addEventListener(MouseEvent.CLICK, Clicked);
i.addEventListener(MouseEvent.CLICK, Clicked);
j.addEventListener(MouseEvent.CLICK, Clicked);
k.addEventListener(MouseEvent.CLICK, Clicked);
l.addEventListener(MouseEvent.CLICK, Clicked);
m.addEventListener(MouseEvent.CLICK, Clicked);
n.addEventListener(MouseEvent.CLICK, Clicked);
o.addEventListener(MouseEvent.CLICK, Clicked);
p.addEventListener(MouseEvent.CLICK, Clicked);

function Clicked(clickInfo:MouseEvent){
trace("Clique");
switch(clickInfo.target){
case a:
clickInfo.target.gotoAndStop(2);
break;
case b:
clickInfo.target.gotoAndStop(3);
}
}

And I want you to click on any of the letters that you make appear any of the 4 objects that I decided

Aucun commentaire:

Enregistrer un commentaire