stop();
003 | var vLevel:Number = 0; |
005 | var vNyawa:Number = 5; |
006 | var vJumlahLevel:Number = 8; |
007 | var vSkorIkan:Number = 10; |
008 | var vSkorBom:Number = -25; |
009 | var vSkorMinUtkNaikStage:Number = 250; |
016 | mc_tux.onEnterFrame = function () { |
020 | if (Key.isDown(Key.UP)){ |
023 | if (Key.isDown(Key.DOWN)){ |
026 | if (Key.isDown(Key.LEFT)){ |
029 | if (Key.isDown(Key.RIGHT)){ |
032 | if ( this ._x<0 || this ._x > (Stage.width - this ._width)){ |
035 | if ( this ._y<0 || this ._y > (Stage.height - this ._height)){ |
046 | fGameOver = function () { |
047 | for (i = 1; i < (vJumlahLevel + 2); i++) { |
048 | removeMovieClip(eval( "mc_ikan" +i)); |
049 | removeMovieClip(eval( "mc_bom" +i)) |
050 | removeMovieClip(eval( "mc_bom" +i+ "meledak" )); |
052 | gotoAndStop( "gameover" ); |
056 | fDeteksiKejadian = function (vtNamaBaru, vtPoin, vtBelumKena) { |
064 | if (vtNamaBaru.hitTest(mc_tux) && vtNamaBaru.vtBelumKena) { |
067 | if (vSkor == (vSkorMinUtkNaikStage * vLevel)){ |
069 | fTampilanLevel( "Level " +vLevel); |
078 | if (vtPoin!=vSkorIkan){ |
080 | duplicateMovieClip(mc_duarr,eval(vtNamaBaru+ "meledak" ), this .getNextHighestDepth()); |
081 | setProperty(eval(vtNamaBaru+ "meledak" ),_x,getProperty(mc_tux,_x)); |
082 | setProperty(eval(vtNamaBaru+ "meledak" ),_y,getProperty(mc_tux,_y)); |
084 | removeMovieClip(eval(vtNamaBaru+ "meledak" )); |
087 | vtNamaBaru.vtBelumKena = false ; |
088 | vtNamaBaru._visible = false ; |
093 | fKloning = function (vtNama_mc, vtBanyak, vtPoin) { |
094 | for (i=1; i<vtBanyak; i++) { |
095 | var vtNamaBaru:String = vtNama_mc+i; |
096 | duplicateMovieClip(vtNama_mc, vtNamaBaru, this .getNextHighestDepth()); |
097 | setProperty(vtNamaBaru, _x, random(Stage.width)); |
098 | setProperty(vtNamaBaru, _y, Stage.height); |
099 | fNaikTurun(vtNamaBaru,5+random(5*vLevel),vtPoin); |
101 | removeMovieClip(eval(vtNama_mc+(vtBanyak))); |
105 | fNaikStage = function () { |
107 | fKloning( "mc_ikan" ,(vJumlahLevel-vLevel),vSkorIkan); |
108 | fKloning( "mc_bom" ,(vLevel+1),vSkorBom); |
112 | fNaikTurun = function (vtNamaBaru, vtKecepatan, vtPoin) { |
113 | var vtBelumKena:Boolean = true ; |
114 | eval(vtNamaBaru).onEnterFrame = function (){ |
116 | if ((vLevel > vJumlahLevel) || (vNyawa < 1)) { |
119 | setProperty( this , _y, getProperty( this , _y) + vtKecepatan); |
120 | fDeteksiKejadian(eval(vtNamaBaru),vtPoin,vtBelumKena); |
122 | if ( this ._y > (Stage.height+60)) { |
123 | setProperty( this , _y, (random(Stage.height))-(Stage.height)); |
124 | setProperty( this , _x, random(Stage.width)); |
125 | this .vtBelumKena = true ; |
126 | this ._visible = true ; |
132 | fTampilanLevel = function (vtString) { |
133 | txt_level.text=vtString; |
skrip untuk disimpan di frame ‘game over’:
03 | var vInputNamaTerakhir:String = so_skor.data.namaTerakhir; |
04 | var vJuaraKe:Number = 6; |
05 | var j:Number = jmlTopSkorer; |
08 | btn_ok.onPress= function () |
12 | if (vSkor > eval( "so_skor.data.topSkor" +i)){ |
18 | while (vJuaraKe <= j) { |
19 | so_skor.data[ "topSkor" +j] = so_skor.data[ "topSkor" +(j-1)]; |
20 | so_skor.data[ "namaTopSkorer" +j] = so_skor.data[ "namaTopSkorer" +(j-1)]; |
23 | so_skor.data[ "topSkor" +vJuaraKe] = vSkor; |
24 | so_skor.data[ "namaTopSkorer" +vJuaraKe] = text_namaSkorer.text; |
26 | so_skor.data.namaTerakhir = text_namaSkorer.text; |
|
Tidak ada komentar:
Posting Komentar