• Jueves 28 de Marzo de 2024, 14:08

Autor Tema:  Juego De Memorama  (Leído 23550 veces)

°ESCARNIO°

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
Juego De Memorama
« en: Viernes 22 de Octubre de 2004, 00:50 »
0
HOLA! QUE TAL, COMO ESTAN. LOS SALUDO Y ME PRESENTO, SOY NUEVO EN EL FORO.

SOY NOVATO EN EL DISEÑO EN FLASH, Y REQUIERO HACER EL CLASICO JUEGO DE MEMORAMA (SENCILLO)

ALGUNO DE USTEDES PODRIA AYUDARME? DONDE PUEDO ENCONTRAR UNA GUIA PARA COMENZARLO? CODIGOS DE EJEMPLO?

SE LOS AGRADECERIA MUCHO.

 :)

wanaya

  • Nuevo Miembro
  • *
  • Mensajes: 5
    • Ver Perfil
Re: Juego De Memorama
« Respuesta #1 en: Sábado 30 de Octubre de 2004, 01:16 »
0
busca en www.flashkit.com
hay muchos ejemplos
saludos!!!

alesitabonita

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
Re: Juego De Memorama
« Respuesta #2 en: Miércoles 20 de Abril de 2005, 00:10 »
0
:o la

yo si te lo doy...ja


tuve problemas para encontrarlo y estaba en apuros pero aqui lo tengo... :) ...aprovenchenlo


/*
* Function createDeck -
* creates an array to serve as a sorted card model
*/
function createDeck() {
   // create cards
   startDeck = new Array();
   // each card = it's array position + 1
   for (x=0;x<picCount;x++) {
      startDeck
  • = x + 1;

   }
   return startDeck;
}






/*
* Function shuffle - when given a deck of N cards (array) the
* shuffle will return a deck of N cards with the same elements
* of the given deck in random order
*/
function shuffle(deckOld) {
   // creating the deck we will return
   deck = new Array();
   // fill array of cards with unique pics
   do {
   //*** NOT INDENTED FOR WEB PAGE PURPOSES ***
   newRandom = Math.floor(deckOld.length*Math.random());
   deck.push(deckOld[newRandom]);
      
   // copy array
   scanData = new Array();
   scanData = scanData.concat(deck);
      
   // if last added was duplicate, than remove.
   if (scanData.sort(Array.UNIQUESORT) == 0) {
      deck.pop();
   }
      
   } while (deck.length<deckOld.length);
   
   // return the finished array
   return deck;
}





/*
* Function deal - takes the cards and deals them out onto
* the screen.  Supply unique picture number and uPic*2 cards
* are delt upon the screen.
*
* Parameters:
* uPic = number of unique pictures to deal
* deck of cards to deal it from (all pictures)
*/
function deal(uPic, cardDeck) {
   moveY = 1;
   moveX = 1;
   // go to next row after rowBreak cards are delt.
   rowBreak = 8;
   
   //initialize decks
   deck1 = new Array();
   deck2 = new Array();
   // shuffle full deck
   deck1 = shuffle(cardDeck);
   // take only the number of cards needed.
   deck1 = deck1.slice(0,uPic);
   // deck 2 is shuffled cards of deck1
   deck2 = shuffle(deck1);
   
   // lay out twice the uniques for duplication.
   for (icount=0; icount<(2*uPic); icount++) {
//*** NOT INDENTED FOR WEB PAGE PURPOSES ***
   curName = "pc"+icount;
   moveX = (icount%rowBreak)+1;
   duplicateMovieClip(_root.pCard, curName, icount);
   // need eval since curName is only a string
   // and not an object pointer
   with (eval(curName)) {
      // position the card
      _x = (moveX-1)*110+15;
      _y = 150*moveY-125;
      // now pick the picture for the card

// curPicNum is from deck1 if odd and deck2 if even
curPicNum = (icount % 2 == 0) ? (deck2.pop()) : (deck1.pop());
      theCard.cardFace.gotoAndStop(curPicNum);
   }
   if ((icount+1)%rowBreak == 0) {
      moveY++;
   }
}
}










// increase number of cards in play
_root.cardsInPlay++;






// if one card is in play then hold
// if 2 are in play then check for correctness
if (_root.cardsInPlay == 1) {
   gotoAndPlay("holdDown");
} else if (_root.cardsInPlay == 2) {
   // check for correctness race condition here
   if (_root.card2Match == cardFace._currentframe) {
      gotoAndPlay("correctMatch");
   } else {
      _root.card2Match = "";
   }
}






// remove this card from being in play.
_root.cardsInPlay--;
// return to the beginning.
gotoAndStop("cardTurn");





// remove this card from being in play.
_root.cardsInPlay--;
// one less number of total cards
_root.totalCardsNum--;

// check if game is over
if (_root.totalCardsNum == 0) {
   _root.gotoAndPlay("Ender");
   stop();   
} else {
   stop();
}








on (release) {
   // only animate 2 unique cards at any given time.
if ((_root.cardsInPlay < 2) && (this.theCard._currentframe <= 1))
{
   // if this is the first card then save picture number
   //*** NOT INDENTED FOR WEBPAGE PURPOSES ***
   if (_root.cardsInPlay == 1) {
    _root.card2Match = this.theCard.cardFace._currentframe;
   }

   // begin animating
   this.theCard.play();
   // count attempt
   _root.attemptCount++;
   _root.gameAttempts = "ATTEMPTS: "
   + Math.round(_root.attemptCount / 2);
}
}




// create a deck
fullDeck = new Array();
fullDeck = createDeck();
// Total unique cards
totalUniqueCards = 16;
// Total number of cards in play
totalCardsNum = totalUniqueCards * 2;
// deal the cards + duplicates from the deck
deal(totalUniqueCards, fullDeck);
// wait here now.
stop();





onClipEvent(load) {
   staticPrefix = "TIMER: ";
   startTime = getTimer();
   staticSuffix = " seconds";
}
onClipEvent(enterFrame) {
   curTime = getTimer();
   elapsed = curTime - startTime;
   _root.secondsElapsed = Math.floor(elapsed / 1000);
   //trace(secondsElapsed);
   this.gameTime = staticPrefix +
   _root.secondsElapsed + staticSuffix;
}





// make sure someone didn't cheat with right mouse click
if (_root.totalCardsNum != 0) {
   gotoAndPlay("beginning");
}

// get peices
seconds = _root.secondsElapsed;
numAttempts = Math.floor(_root.attemptCount / 2)

// now print scoring
sumText = "You took " + seconds
+ " seconds to complete this game.\nYou did so in "
+ numAttempts + " attempts.\n\nYour final score is: "
_root.summary = sumText;
_root.finalScore = seconds * numAttempts;
// stop stage
stop();


para mas detalles consulta http://www.bleacheatingfreaks.com/flash/games/memory/

GsOiD

  • Miembro activo
  • **
  • Mensajes: 83
  • Nacionalidad: mx
    • Ver Perfil
Re: Juego De Memorama
« Respuesta #3 en: Jueves 15 de Noviembre de 2007, 02:12 »
0
se carga bastante lento ...  :whistling:
 yo estoy haciendo un memorama =D.. algo cencillo claro... cuando lo termine lo pondré aquí.. para que aquel que le de flojera hacer esto.. sólo copie y pegue xD ....

marha1

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
Re: Juego De Memorama
« Respuesta #4 en: Viernes 11 de Abril de 2008, 03:48 »
0
hollllaaa vGsOiD


oye me interesa saber donde es decir en que programa estas realizando el memorama ya que tengo una tarea en la que tengo que hacer un memorama contemas relacionados con programas de la compu (word, excel etc. )

por fas si me puedes ayudar de antemano te lo agradecere
bye cuidate  espero  me puedas ayudar ya que me urge es para el 18 de abril . y si no lo entrego no tenfre calificacion

marha-3@hotmail.com

porfas comunicate conmigo vale adios