STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
This is the info page for Flash #23345 |
COBALL |
Play Rules Credits |
Réalisation Toon 8 |
Gather Together three balls with the same colour to get rid of them. You will win when all the balls are vanished. Use the mouse to aim at the balls |
Score 0 |
Next Ball |
Play again |
Menu |
ActionScript [AS1/AS2]
Frame 1stopAllSounds();Frame 5stop();Frame 6function GetNewScore(PrevScore, ValScoreBille, NbBillesSupp, ValNbBillesMinPourSupp) { return((ValScoreBille * ((NbBillesSupp + NbBillesSupp) - ValNbBillesMinPourSupp)) + PrevScore); } function InitTabJeu(TabJeu, MaxLignes, MaxColonnes, BillesMax, DepColInit) { var CptLg; var CptCol; var TabTmp; var RndCaseDecalRemplir; CptLg = 0; while (CptLg < MaxLignes) { CptCol = 0; RndCaseDecalRemplir = DepColInit + Math.floor(Math.random() * 4); CptCol = 0; while (CptCol < MaxColonnes) { if (CptCol >= RndCaseDecalRemplir) { TabJeu[CptLg + (CptCol * MaxLignes)] = Math.floor(Math.random() * BillesMax) + 1; } else { TabJeu[CptLg + (CptCol * MaxLignes)] = 0; } CptCol++; } CptLg++; } } function CreationTabJeu(MaxLignes, MaxColonnes) { var Cpt; var TabJeu; TabJeu = new Array(); Cpt = 0; while (Cpt < (MaxLignes * MaxColonnes)) { TabJeu.push(0); Cpt++; } return(TabJeu); } function DuplicationClipBilles(BillesMovieClip, StrClipBilles, MaxLignes, MaxColonnes) { var CptLg; var CptCol; var BilleObj; CptLg = 0; while (CptLg < MaxLignes) { CptCol = 0; while (CptCol < MaxColonnes) { duplicateMovieClip (BillesMovieClip, ((StrClipBilles + CptLg) + "_") + CptCol, (CptLg + (MaxLignes * CptCol)) + 1); CptCol++; } CptLg++; } } function GetNewBilleToPlay(TabJeu, ValNbBillesMax) { var Cpt; var TableCptBilles; var TotalBilles; var RndNb; TableCptBilles = new Array(); Cpt = 0; while (ValNbBillesMax >= Cpt) { TableCptBilles.push(0); Cpt++; } TotalBilles = 0; Cpt = 0; while (Cpt < TabJeu.length) { TableCptBilles[TabJeu[Cpt]]++; if (TabJeu[Cpt]) { TotalBilles++; } Cpt++; } RndNb = Math.floor(Math.random() * TotalBilles) + 1; Cpt = 1; while (0 < RndNb) { RndNb = RndNb - TableCptBilles[Cpt]; Cpt++; } delete TableCptBilles; return(Cpt - 1); } function CalculNbBillesParCouleur(TabJeu, ValNbBillesMax) { var Cpt; var TableCptBilles; TableCptBilles = new Array(); Cpt = 0; while (ValNbBillesMax >= Cpt) { TableCptBilles.push(0); Cpt++; } Cpt = 0; while (Cpt < TabJeu.length) { TableCptBilles[TabJeu[Cpt++]]++; } return(TableCptBilles); } function GetTableIndexMax(Table, PrevIndex) { var Cpt; var NewIdMax; var Boucle; if (PrevIndex < 0) { (NewIdMax = 1); (Cpt = 1); while (Cpt < Table.length) { if (Table[Cpt] >= Table[NewIdMax]) { NewIdMax = Cpt; } Cpt++; } } else { NewIdMax = 0; Boucle = 1; Cpt = 1; while ((Cpt < Table.length) && (Boucle)) { if ((Table[Cpt] == Table[PrevIndex]) && (Cpt != PrevIndex)) { NewIdMax = Cpt; Boucle = 0; } else if ((Table[Cpt] < Table[PrevIndex]) && (Table[Cpt] >= Table[NewIdMax])) { NewIdMax = Cpt; } Cpt++; } if (!NewIdMax) { NewIdMax = Math.floor(Math.random() * (Table.length - 1)) + 1; } } return(NewIdMax); } function TableJeuVide(TabJeu) { var Cpt; Cpt = 0; while ((!TabJeu[Cpt]) && (Cpt < TabJeu.length)) { Cpt++; } return(Cpt == TabJeu.length); } function AfficheJeu(TabJeu, StrClipBilles, MaxLignes, MaxColonnes, XStart, YStart, CaseLength) { var CptLg; var CptCol; var Cpt; var BilleObj; Cpt = 0; CptCol = 0; while (CptCol < MaxColonnes) { CptLg = 0; while (CptLg < MaxLignes) { BilleObj = eval (((StrClipBilles + CptLg) + "_") + CptCol); BilleObj._x = (XStart + (CptLg * CaseLength)) + (CaseLength / 2); BilleObj._y = (YStart + (CptCol * CaseLength)) + (CaseLength / 2); if (TabJeu[Cpt] == 0) { BilleObj._visible = 0; } else { BilleObj._visible = 1; BilleObj.gotoAndStop(TabJeu[Cpt]); } Cpt++; CptLg++; } CptCol++; } } function InitAlphaClipBilles(StrClipBilles, MaxLignes, MaxColonnes) { var CptLg; var CptCol; var BilleObj; CptCol = 0; while (CptCol < MaxColonnes) { CptLg = 0; while (CptLg < MaxLignes) { BilleObj = eval (((StrClipBilles + CptLg) + "_") + CptCol); BilleObj._alpha = 100; CptLg++; } CptCol++; } } function GetIndexFromMouse(XMouse, YMouse, XStartTable, YStartTable, CaseLength, TableMaxLg, TableMaxCol) { var XTable; var YTable; XTable = Math.floor((XMouse - XStartTable) / CaseLength); YTable = Math.floor((YMouse - YStartTable) / CaseLength); if ((((XTable >= 0) && (XTable < TableMaxLg)) && (YTable >= 0)) && (YTable < TableMaxCol)) { return(XTable + (YTable * TableMaxLg)); } return(-1); } function GetXCaseForNewBille(XMouse, XStartTable, CaseLength, TableMaxLg) { var XTable; XTable = Math.floor((XMouse - XStartTable) / CaseLength); if (XTable < 0) { return(0); } if (XTable >= TableMaxLg) { return(TableMaxLg - 1); } return(XTable); } function SuppBillesTable(TableBilles, IndexTableBilles, MaxLg, MaxCol, NbBillesSupp) { var Cpt; var Count; var TableIndexVerif = null; Count = 0; if (TableBilles[IndexTableBilles] != 0) { TableIndexVerif = CreationTabJeu(MaxLg, MaxCol); DetTableIndexBillesSupp(TableBilles, IndexTableBilles, MaxLg, MaxCol, TableIndexVerif); Count = 0; Cpt = 0; while (Cpt < TableIndexVerif.length) { if (TableIndexVerif[Cpt]) { Count++; } Cpt++; } if (Count >= NbBillesSupp) { Cpt = 0; while (Cpt < TableIndexVerif.length) { if (TableIndexVerif[Cpt]) { TableBilles[Cpt] = 0; } Cpt++; } } delete TableIndexVerif; } return(Count); } function RafraichirTabBilles(TableBilles, MaxLg, MaxCol, ValVide) { var CptLg; var CptCol; var IdColVide; var IdColPlein; var IdTabColVide; var IdTabColPlein; CptLg = 0; while (CptLg < MaxLg) { IdColVide = MaxCol - 1; IdColPlein = MaxCol - 2; while (IdColPlein >= 0) { IdTabColVide = CptLg + (IdColVide * MaxLg); IdTabColPlein = CptLg + (IdColPlein * MaxLg); if (TableBilles[IdTabColVide] == ValVide) { if (TableBilles[IdTabColPlein] != ValVide) { TableBilles[IdTabColVide] = TableBilles[IdTabColPlein]; TableBilles[IdTabColPlein] = ValVide; IdColVide--; } } else { IdColVide--; } IdColPlein--; } CptLg++; } } function AfficherSuppBillesAlpha(TableBilles, MaxLg, MaxCol, StrClipBilles, ValAlpha) { var Cpt; var CptX; var CptY; var BillesObj; Cpt = 0; CptY = 0; while (CptY < MaxCol) { CptX = 0; while (CptX < MaxLg) { BillesObj = eval (((StrClipBilles + CptX) + "_") + CptY); if (TableBilles[Cpt] != BillesObj._currentFrame) { BillesObj._alpha = ValAlpha; } Cpt++; CptX++; } CptY++; } } function RafraichirAffichageTableBilles(TableBilles, MaxLg, MaxCol, StrClipBilles) { var Cpt; var CptX; var CptY; var BillesObj; Cpt = 0; CptY = 0; while (CptY < MaxCol) { CptX = 0; while (CptX < MaxLg) { BillesObj = eval (((StrClipBilles + CptX) + "_") + CptY); if (TableBilles[Cpt] == 0) { BillesObj._visible = 0; } else { BillesObj.gotoAndStop(TableBilles[Cpt]); BillesObj._visible = 1; } Cpt++; CptX++; } CptY++; } } function DetTableIndexBillesSupp(TableBilles, IndexTableBilles, MaxLg, MaxCol, TableIndex) { var XTable; var YTable; var NewIndex; TableIndex[IndexTableBilles] = 1; XTable = IndexTableBilles % MaxLg; YTable = Math.floor(IndexTableBilles / MaxLg); NewIndex = (XTable - 1) + (YTable * MaxLg); if ((((XTable - 1) >= 0) && (!TableIndex[NewIndex])) && (TableBilles[IndexTableBilles] == TableBilles[NewIndex])) { DetTableIndexBillesSupp(TableBilles, NewIndex, MaxLg, MaxCol, TableIndex); } NewIndex = (XTable + 1) + (YTable * MaxLg); if ((((XTable + 1) < MaxLg) && (!TableIndex[NewIndex])) && (TableBilles[IndexTableBilles] == TableBilles[NewIndex])) { DetTableIndexBillesSupp(TableBilles, NewIndex, MaxLg, MaxCol, TableIndex); } NewIndex = XTable + ((YTable - 1) * MaxLg); if ((((YTable - 1) >= 0) && (!TableIndex[NewIndex])) && (TableBilles[IndexTableBilles] == TableBilles[NewIndex])) { DetTableIndexBillesSupp(TableBilles, NewIndex, MaxLg, MaxCol, TableIndex); } NewIndex = XTable + ((YTable + 1) * MaxLg); if ((((YTable + 1) < MaxCol) && (!TableIndex[NewIndex])) && (TableBilles[IndexTableBilles] == TableBilles[NewIndex])) { DetTableIndexBillesSupp(TableBilles, NewIndex, MaxLg, MaxCol, TableIndex); } } G_SCREEN_WIDTH = 350; G_SCREEN_HEIGHT = 350; G_CASE_SIZE = 18; G_START_X = 65; G_START_Y = 123; BtnClickOk = 0; ScoreBille = 35; ScoreTotal = 0; ValNbBillesSupp = 0; PrevIndexTable = 0; CurrentIndexTable = 0; YPosNewBille = G_START_Y - (G_CASE_SIZE / 2); NbBillesMinPourSupp = 3; ValAlphaBillesSupp = 30; NbMaxLignes = 15; NbMaxColonnes = 12; NbBillesMax = 5; NomClipBilles = "Billes_"; GameArray = null; CompteBillesArray = null; IndexCompteBillesArray = 0; InitBillesColonnes = 4; ValFrameCurrentBille = -1; ValCaseXBille = 0;Frame 7DuplicationClipBilles(_root.ClipBille, NomClipBilles, NbMaxLignes, NbMaxColonnes); GameArray = CreationTabJeu(NbMaxLignes, NbMaxColonnes); InitTabJeu(GameArray, NbMaxLignes, NbMaxColonnes, NbBillesMax, InitBillesColonnes); AfficheJeu(GameArray, NomClipBilles, NbMaxLignes, NbMaxColonnes, G_START_X, G_START_Y, G_CASE_SIZE);Frame 8ValFrameCurrentBille = GetNewBilleToPlay(GameArray, NbBillesMax); ClipCurrentBille.gotoAndStop(ValFrameCurrentBille);Frame 9if (BtnClickOk) { BtnClickOk = 0; ClipCanon.play(); PrevIndexTable = ValCaseXBille; CurrentIndexTable = ValCaseXBille; if (GameArray[CurrentIndexTable] != 0) { gotoAndPlay (50); } else { GameArray[CurrentIndexTable] = ValCurrentBille; CurrentIndexTable = CurrentIndexTable + NbMaxLignes; RafraichirAffichageTableBilles(GameArray, NbMaxLignes, NbMaxColonnes, NomClipBilles); gotoAndPlay (15); } } else { play(); }Frame 10prevFrame();Frame 15if ((CurrentIndexTable >= (NbMaxLignes * NbMaxColonnes)) || (GameArray[CurrentIndexTable] != 0)) { gotoAndPlay (29); } else { GameArray[PrevIndexTable] = 0; GameArray[CurrentIndexTable] = ValFrameCurrentBille; PrevIndexTable = CurrentIndexTable; CurrentIndexTable = CurrentIndexTable + NbMaxLignes; RafraichirAffichageTableBilles(GameArray, NbMaxLignes, NbMaxColonnes, NomClipBilles); }Frame 18gotoAndPlay (15);Frame 29ValNbBillesSupp = SuppBillesTable(GameArray, PrevIndexTable, NbMaxLignes, NbMaxColonnes, NbBillesMinPourSupp); if (ValNbBillesSupp >= NbBillesMinPourSupp) { ScoreTotal = GetNewScore(ScoreTotal, ScoreBille, ValNbBillesSupp, NbBillesMinPourSupp); TextScore = "Score :\n" + ScoreTotal; AfficherSuppBillesAlpha(GameArray, NbMaxLignes, NbMaxColonnes, NomClipBilles, ValAlphaBillesSupp); }Frame 34InitAlphaClipBilles(NomClipBilles, NbMaxLignes, NbMaxColonnes); RafraichirTabBilles(GameArray, NbMaxLignes, NbMaxColonnes, 0); RafraichirAffichageTableBilles(GameArray, NbMaxLignes, NbMaxColonnes, NomClipBilles); if (TableJeuVide(GameArray)) { gotoAndPlay (50); } else { gotoAndPlay (8); }Frame 47stop();Frame 50delete GameArray; GameArray = CreationTabJeu(NbMaxLignes, NbMaxColonnes); AfficheJeu(GameArray, NomClipBilles, NbMaxLignes, NbMaxColonnes, G_START_X, G_START_Y, G_CASE_SIZE); stop();Symbol 18 Buttonon (release) { gotoAndPlay (6); }Symbol 28 MovieClip Frame 1stop();Symbol 29 Buttonon (release) { BtnClickOk = 1; }Symbol 35 MovieClip Frame 1stop();Symbol 40 MovieClip Frame 1_root.ValCaseXBille = _root.GetXCaseForNewBille(_root._xmouse, _root.G_START_X, _root.G_CASE_SIZE, _root.NbMaxLignes); _root.ClipCanon._x = (_root.G_START_X + (_root.G_CASE_SIZE / 2)) + (_root.ValCaseXBille * _root.G_CASE_SIZE); play();Symbol 40 MovieClip Frame 2prevFrame();Symbol 43 Buttonon (release) { InitTabJeu(GameArray, NbMaxLignes, NbMaxColonnes, NbBillesMax, InitBillesColonnes); AfficheJeu(GameArray, NomClipBilles, NbMaxLignes, NbMaxColonnes, G_START_X, G_START_Y, G_CASE_SIZE); ScoreTotal = 0; TextScore = "Score :\n0"; gotoAndPlay (8); }Symbol 44 Buttonon (release) { gotoAndPlay (1); }
Library Items
Symbol 1 Bitmap | Used by:2 | |
Symbol 2 Graphic | Uses:1 | Used by:Timeline |
Symbol 3 Graphic | Used by:Timeline | |
Symbol 4 Graphic | Used by:10 Timeline | |
Symbol 5 Graphic | Used by:10 Timeline | |
Symbol 6 Graphic | Used by:10 Timeline | |
Symbol 7 Graphic | Used by:28 Timeline | |
Symbol 8 Graphic | Used by:10 | |
Symbol 9 Graphic | Used by:10 | |
Symbol 10 MovieClip | Uses:8 4 5 6 9 | Used by:28 Timeline |
Symbol 11 Font | Used by:12 13 41 42 | |
Symbol 12 Text | Uses:11 | Used by:Timeline |
Symbol 13 Text | Uses:11 | Used by:Timeline |
Symbol 14 Font | Used by:15 | |
Symbol 15 Text | Uses:14 | Used by:Timeline |
Symbol 16 Graphic | Used by:18 21 23 29 43 44 | |
Symbol 17 Sound | Used by:18 43 44 | |
Symbol 18 Button | Uses:16 17 | Used by:Timeline |
Symbol 19 Font | Used by:20 | |
Symbol 20 Text | Uses:19 | Used by:21 |
Symbol 21 Button | Uses:20 16 | Used by:Timeline |
Symbol 22 Graphic | Used by:23 | |
Symbol 23 Button | Uses:22 16 | Used by:Timeline |
Symbol 24 Sound | Used by:Timeline | |
Symbol 25 Graphic | Used by:Timeline | |
Symbol 26 Graphic | Used by:28 | |
Symbol 27 Sound | Used by:28 | |
Symbol 28 MovieClip | Uses:26 7 10 27 | Used by:Timeline |
Symbol 29 Button | Uses:16 | Used by:Timeline |
Symbol 30 Graphic | Used by:35 | |
Symbol 31 Graphic | Used by:35 | |
Symbol 32 Graphic | Used by:35 | |
Symbol 33 Graphic | Used by:35 | |
Symbol 34 Graphic | Used by:35 | |
Symbol 35 MovieClip | Uses:30 31 32 33 34 | Used by:Timeline |
Symbol 36 Font | Used by:37 38 | |
Symbol 37 EditableText | Uses:36 | Used by:Timeline |
Symbol 38 Text | Uses:36 | Used by:Timeline |
Symbol 39 Graphic | Used by:40 | |
Symbol 40 MovieClip | Uses:39 | Used by:Timeline |
Symbol 41 Text | Uses:11 | Used by:Timeline |
Symbol 42 Text | Uses:11 | Used by:Timeline |
Symbol 43 Button | Uses:16 17 | Used by:Timeline |
Symbol 44 Button | Uses:16 17 | Used by:Timeline |
Symbol 45 Graphic | Used by:Timeline |
Instance Names
"ClipCanon" | Frame 6 | Symbol 28 MovieClip |
"ClipBille" | Frame 6 | Symbol 35 MovieClip |
"ClipCurrentBille" | Frame 6 | Symbol 35 MovieClip |
Special Tags
Protect (24) | Timeline Frame 1 | 0 bytes "" |
Labels
"Play" | Frame 8 |
"BilleTombe" | Frame 15 |
"Rafraichir" | Frame 29 |
"GameOver" | Frame 50 |
Dynamic Text Variables
TextScore | Symbol 37 EditableText | "Score 0" |
|