Monday, 25 January 2016

SIMPLE PAIR GAME AS2

[AS2] Help with Simple Pairs Game


--------------------------------------------------------------------------------------------------------------------------
Read More:
http://img2.timg.co.il/forums/58067874.pdf
http://www.actionscript.org/forums/gaming-and-game-development/265732-as2-help-simple-pairs-game.html
http://flashcollege.blogspot.co.uk/2016/02/tile-matching-game-as2.html
https://www.youtube.com/watch?v=IC1EH173DIY
Find the Pair as3
https://www.google.co.uk/search?q=Find+the+Pair+as3&rlz=1C1GNAM_en-GBGB681GB681&biw=1280&bih=655&source=lnms&sa=X&ved=0ahUKEwjg-dCGoKzLAhWBVhoKHSH_DmsQ_AUIBigA&dpr=1
http://www.littlebigplay.com/shajby/java/index3.php
http://stackoverflow.com/questions/4301508/convert-list-of-pairs-into-array-groups-in-as3
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
STEP:1
MAKE 2 FRAME BASED 4 MOVIE CLIPS SYMBOLS AND GIVE
INSTANCE NAMES
circle
circle2
square
square2
--------------------------------------------------------------------------------------------------------------------------
STEP:2
--------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------
 PASTE LOAD CODE  INSIDE MOVIE CLIP FOR EACH MOVIE CLIPS ON BY
ONE
------------------------------------------------------------------------------------------------------------------------
onClipEvent (load) {
gotoAndStop("back");
}
------------------------------------------------------------------------------------------------------------------------

TILE MATCHING GAME AS2

------------------------------------------------------------------------------------------------------------------------

var second:Boolean=false;
var firstCard_mc:MovieClip;
var secondCard_mc:MovieClip;

circle.onPress = function() {  
circle.gotoAndStop("front");
if(second){
secondCard_mc=this;
if(firstCard_mc.myReference==secondCard_mc.myReference) { trace("CORRECT"); }
else { firstCard_mc.gotoAndStop("back"); secondCard_mc.gotoAndStop("back"); }
second=false;
}
else{
firstCard_mc=this;
second=true;
}}
circle2.onPress = function() {  
circle2.gotoAndStop("front");
if(second){
secondCard_mc=this;
if(firstCard_mc.myReference==secondCard_mc.myReference) { trace("CORRECT"); }
else { firstCard_mc.gotoAndStop("back"); secondCard_mc.gotoAndStop("back"); }
second=false;
}
else{
firstCard_mc=this;
second=true;
}}


square.onPress = function() {  
square.gotoAndStop("front");
if(second){
secondCard_mc=this;
if(firstCard_mc.myReference==secondCard_mc.myReference) { trace("CORRECT"); }
else { firstCard_mc.gotoAndStop("back"); secondCard_mc.gotoAndStop("back"); }
second=false;
}
else{
firstCard_mc=this;
second=true;
}}
square2.onPress = function() {  
square2.gotoAndStop("front");
if(second){
secondCard_mc=this;
if(firstCard_mc.myReference==secondCard_mc.myReference) { trace("CORRECT"); }
else { firstCard_mc.gotoAndStop("back"); secondCard_mc.gotoAndStop("back"); }
second=false;
}
else{
firstCard_mc=this;
second=true;
}}

------------------------------------------------------------------------------------------------------------------------
STEP:3
-------------------------------------------------------------------------------------------------------------------------
MATCHING GAME AS2
------------------------------------------------------------------------------------------------------------------------
REPEAT THIS METHOD FOR ALL MOVIE CLIPS:

var myReference:Number = 1;

GIVE LABEL NAMES TWO FRAMES:

front
back

--------------------------------------------------------------------------------------------------------------------------







EmoticonEmoticon