STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228066
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5120

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/85211790?noj=FRM85211790-28DC" width="1" height="1"></div>

Coball.swf

This is the info page for
Flash #23345

(Click the ID number above for more basic data on this flash file.)


Text
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 1
stopAllSounds();
Frame 5
stop();
Frame 6
function 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 7
DuplicationClipBilles(_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 8
ValFrameCurrentBille = GetNewBilleToPlay(GameArray, NbBillesMax); ClipCurrentBille.gotoAndStop(ValFrameCurrentBille);
Frame 9
if (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 10
prevFrame();
Frame 15
if ((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 18
gotoAndPlay (15);
Frame 29
ValNbBillesSupp = 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 34
InitAlphaClipBilles(NomClipBilles, NbMaxLignes, NbMaxColonnes); RafraichirTabBilles(GameArray, NbMaxLignes, NbMaxColonnes, 0); RafraichirAffichageTableBilles(GameArray, NbMaxLignes, NbMaxColonnes, NomClipBilles); if (TableJeuVide(GameArray)) { gotoAndPlay (50); } else { gotoAndPlay (8); }
Frame 47
stop();
Frame 50
delete GameArray; GameArray = CreationTabJeu(NbMaxLignes, NbMaxColonnes); AfficheJeu(GameArray, NomClipBilles, NbMaxLignes, NbMaxColonnes, G_START_X, G_START_Y, G_CASE_SIZE); stop();
Symbol 18 Button
on (release) { gotoAndPlay (6); }
Symbol 28 MovieClip Frame 1
stop();
Symbol 29 Button
on (release) { BtnClickOk = 1; }
Symbol 35 MovieClip Frame 1
stop();
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 2
prevFrame();
Symbol 43 Button
on (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 Button
on (release) { gotoAndPlay (1); }

Library Items

Symbol 1 BitmapUsed by:2
Symbol 2 GraphicUses:1Used by:Timeline
Symbol 3 GraphicUsed by:Timeline
Symbol 4 GraphicUsed by:10  Timeline
Symbol 5 GraphicUsed by:10  Timeline
Symbol 6 GraphicUsed by:10  Timeline
Symbol 7 GraphicUsed by:28  Timeline
Symbol 8 GraphicUsed by:10
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClipUses:8 4 5 6 9Used by:28  Timeline
Symbol 11 FontUsed by:12 13 41 42
Symbol 12 TextUses:11Used by:Timeline
Symbol 13 TextUses:11Used by:Timeline
Symbol 14 FontUsed by:15
Symbol 15 TextUses:14Used by:Timeline
Symbol 16 GraphicUsed by:18 21 23 29 43 44
Symbol 17 SoundUsed by:18 43 44
Symbol 18 ButtonUses:16 17Used by:Timeline
Symbol 19 FontUsed by:20
Symbol 20 TextUses:19Used by:21
Symbol 21 ButtonUses:20 16Used by:Timeline
Symbol 22 GraphicUsed by:23
Symbol 23 ButtonUses:22 16Used by:Timeline
Symbol 24 SoundUsed by:Timeline
Symbol 25 GraphicUsed by:Timeline
Symbol 26 GraphicUsed by:28
Symbol 27 SoundUsed by:28
Symbol 28 MovieClipUses:26 7 10 27Used by:Timeline
Symbol 29 ButtonUses:16Used by:Timeline
Symbol 30 GraphicUsed by:35
Symbol 31 GraphicUsed by:35
Symbol 32 GraphicUsed by:35
Symbol 33 GraphicUsed by:35
Symbol 34 GraphicUsed by:35
Symbol 35 MovieClipUses:30 31 32 33 34Used by:Timeline
Symbol 36 FontUsed by:37 38
Symbol 37 EditableTextUses:36Used by:Timeline
Symbol 38 TextUses:36Used by:Timeline
Symbol 39 GraphicUsed by:40
Symbol 40 MovieClipUses:39Used by:Timeline
Symbol 41 TextUses:11Used by:Timeline
Symbol 42 TextUses:11Used by:Timeline
Symbol 43 ButtonUses:16 17Used by:Timeline
Symbol 44 ButtonUses:16 17Used by:Timeline
Symbol 45 GraphicUsed by:Timeline

Instance Names

"ClipCanon"Frame 6Symbol 28 MovieClip
"ClipBille"Frame 6Symbol 35 MovieClip
"ClipCurrentBille"Frame 6Symbol 35 MovieClip

Special Tags

Protect (24)Timeline Frame 10 bytes ""

Labels

"Play"Frame 8
"BilleTombe"Frame 15
"Rafraichir"Frame 29
"GameOver"Frame 50

Dynamic Text Variables

TextScoreSymbol 37 EditableText"Score 0"




http://swfchan.com/5/23345/info.shtml
Created: 26/5 -2019 06:50:51 Last modified: 26/5 -2019 06:50:51 Server time: 28/04 -2024 05:30:24