home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Esportes
/
soccofobia.swf
/
scripts
/
frame_2
/
DoAction.as
Wrap
Text File
|
2008-09-25
|
42KB
|
1,576 lines
function rand_Range(min, max)
{
var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
return _loc1_;
}
function limit(val, min, max)
{
if(val < min)
{
return min;
}
if(val > max)
{
return max;
}
return val;
}
function make_rgb(rr, gg, bb)
{
return (rr * 256 + gg) * 256 + bb;
}
function even(ii)
{
if(ii < 0)
{
ii = ii - 1;
}
if(ii / 2 == Math.floor(ii / 2))
{
return true;
}
return false;
}
function odd(ii)
{
if(ii < 0)
{
ii = ii - 1;
}
if(ii / 2 == Math.floor(ii / 2))
{
return false;
}
return true;
}
function get_Distance(dx, dy)
{
var _loc2_ = dx * dx;
var _loc1_ = dy * dy;
return Math.sqrt(_loc2_ + _loc1_);
}
function replace_Char(ch, dest, pp)
{
var _loc2_ = dest.substr(0,pp) + ch + dest.substr(pp + 1,dest.length - pp - 1);
return _loc2_;
}
function hex(vv)
{
var _loc1_ = "0123456789abcdef";
var _loc4_ = Math.floor(vv / 16);
var _loc2_ = vv % 16;
var _loc3_ = _loc1_.substr(_loc4_,1) + _loc1_.substr(_loc2_,1);
return _loc3_;
}
function colorStr(rr, gg, bb)
{
var _loc1_ = "0x" + hex(rr) + hex(gg) + hex(bb);
return _loc1_;
}
function in_Range(val, min, max)
{
if(val >= min & val <= max)
{
return true;
}
return false;
}
function in_Array(val, wlst)
{
var _loc3_ = false;
var _loc1_ = 0;
while(_loc1_ < wlst.length)
{
if(val == wlst[_loc1_])
{
_loc3_ = true;
}
_loc1_ = _loc1_ + 1;
}
return _loc3_;
}
function draw_Rectangle(x1, y1, x2, y2, target_mc)
{
with(target_mc)
{
moveTo(x1,y1);
lineTo(x2,y1);
lineTo(x2,y2);
lineTo(x1,y2);
lineTo(x1,y1);
}
}
function draw_Circle(xx, yy, radius, target_mc)
{
with(target_mc)
{
var tt = 0.41421356237309503 * radius;
var ss = 0.7071067811865475 * radius;
moveTo(xx + radius,yy);
curveTo(radius + xx,tt + yy,ss + xx,ss + yy);
curveTo(tt + xx,radius + yy,xx,radius + yy);
curveTo(- tt + xx,radius + yy,- ss + xx,ss + yy);
curveTo(- radius + xx,tt + yy,- radius + xx,yy);
curveTo(- radius + xx,- tt + yy,- ss + xx,- ss + yy);
curveTo(- tt + xx,- radius + yy,xx,- radius + yy);
curveTo(tt + xx,- radius + yy,ss + xx,- ss + yy);
curveTo(radius + xx,- tt + yy,radius + xx,yy);
}
}
function draw_Ellipse(xx, yy, xradius, yradius, target_mc)
{
with(target_mc)
{
var mm = (xradius + yradius) * 4;
var px;
var py;
var tt = 0;
while(tt < mm)
{
px = xx + xradius * Math.sin(3.141592653589793 * tt * 2 / mm);
py = yy - yradius * Math.cos(3.141592653589793 * tt * 2 / mm);
if(tt == 0)
{
moveTo(px,py);
}
else
{
lineTo(px,py);
}
tt++;
}
}
}
function draw_solid_Ellipse(xx, yy, xradius, yradius, col, target_mc)
{
with(target_mc)
{
lineStyle(1,col,50);
beginFill(col,100);
var mm = (xradius + yradius) * 4;
var px;
var py;
var tt = 0;
while(tt < mm)
{
px = xx + xradius * Math.sin(3.141592653589793 * tt * 2 / mm);
py = yy - yradius * Math.cos(3.141592653589793 * tt * 2 / mm);
if(tt == 0)
{
moveTo(px,py);
}
else
{
lineTo(px,py);
}
tt++;
}
endFill();
}
}
function draw_Quart1(xx, yy, radius, target_mc)
{
with(target_mc)
{
var tt = 0.41421356237309503 * radius;
var ss = 0.7071067811865475 * radius;
moveTo(xx + radius,yy);
curveTo(radius + xx,tt + yy,ss + xx,ss + yy);
curveTo(tt + xx,radius + yy,xx,radius + yy);
}
}
function draw_Pill(x1, y1, x2, y2, target_mc)
{
with(target_mc)
{
var radius = (y2 - y1) / 2;
var xx = x1 + radius;
var yy = y1 + radius;
var tt = 0.41421356237309503 * radius;
var ss = 0.7071067811865475 * radius;
moveTo(xx,yy + radius);
curveTo(xx - tt,yy + radius,xx - ss,yy + ss);
curveTo(xx - radius,yy + tt,xx - radius,yy);
curveTo(xx - radius,yy - tt,xx - ss,yy - ss);
curveTo(xx - tt,yy - radius,xx,yy - radius);
xx = x2 - radius;
lineto(xx,yy - radius);
curveTo(xx - tt,yy - radius,xx,yy - radius);
curveTo(xx + tt,yy - radius,xx + ss,yy - ss);
curveTo(xx + radius,yy - tt,xx + radius,yy);
curveTo(xx + radius,yy + tt,xx + ss,yy + ss);
curveTo(xx + tt,yy + radius,xx,yy + radius);
xx = x1 + radius;
lineTo(xx,yy + radius);
}
}
function draw_Ellipsoid(x1, y1, x2, y2, bol, target_mc)
{
var cx = (x1 + x2) / 2;
var cy = (y1 + y2) / 2;
var dx = (y2 - y1) / 2;
var dy = (y2 - y1) / 2;
var d1 = (y2 - y1) / 12;
var d2 = (y2 - y1) / 8;
if(bol != "Top")
{
d1 = 0;
}
if(bol != "Bottom")
{
d2 = 0;
}
with(target_mc)
{
moveTo(x1,y1 + dy);
curveTo(x1,y1 + d1,x1 + dx,y1 + d1);
curveTo(cx,y1 - d1,x2 - dx,y1 + d1);
curveTo(x2,y1 + d1,x2,y1 + dy);
lineTo(x2,y2 - dy);
curveTo(x2,y2 - d2,x2 - dx,y2 - d2);
curveTo(cx,y2 + d2,x1 + dx,y2 - d2);
curveTo(x1,y2 - d2,x1,y2 - dy);
lineTo(x1,y1 + dy);
}
}
function draw_Segment(cx, cy, rad_x, rad_y, start_angle, end_angle, target_mc)
{
var xx;
var yy;
var mm = rad_x + rad_y;
var t1 = start_angle * mm / 360;
var t2 = end_angle * mm / 360;
with(target_mc)
{
var tt = t1;
while(tt < t2)
{
xx = cx + rad_x * Math.sin(tt * 3.141592653589793 * 2 / mm);
yy = cy - rad_y * Math.cos(tt * 3.141592653589793 * 2 / mm);
if(tt == t1)
{
moveTo(xx,yy);
}
else
{
lineTo(xx,yy);
}
tt++;
}
xx = cx + rad_x * Math.sin(t2 * 3.141592653589793 * 2 / mm);
yy = cy - rad_y * Math.cos(t2 * 3.141592653589793 * 2 / mm);
lineTo(xx,yy);
}
x_pos = xx;
y_pos = yy;
}
function scale_rect(sBmp, dBmp, x1, y1, w1, h1, x2, y2, w2, h2)
{
var _loc2_ = new flash.display.BitmapData(w1,h1,true,0);
var _loc1_ = new flash.display.BitmapData(w1,h1,true,0);
_loc2_.copyPixels(sBmp,new flash.geom.Rectangle(x1,y1,x1 + w1,y1 + h1),new flash.geom.Point(0,0));
_loc1_.draw(_loc2_,new flash.geom.Matrix(w2 / w1,0,0,h2 / h1));
dBmp.copyPixels(_loc1_,new flash.geom.Rectangle(0,0,w2,h2),new flash.geom.Point(x2,y2));
_loc2_.dispose;
_loc1_.dispose;
}
function merge_clip(w_mc)
{
with(w_mc)
{
var tmp_bmp = new flash.display.BitmapData(_width,_height,true,0);
var myMatrix = new flash.geom.Matrix();
myMatrix.rotate(0);
var translateMatrix = new flash.geom.Matrix();
translateMatrix.translate(0,0);
myMatrix.concat(translateMatrix);
var myCtfm = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
var blendMode = "normal";
var myRectangle = new flash.geom.Rectangle(0,0,_width,_height);
var smooth = true;
tmp_bmp.draw(w_mc,myMatrix,myCtfm,blendMode,myRectangle,smooth);
clear();
attachBitmap(tmp_bmp,0);
}
}
function show_lives()
{
tt = 0;
while(tt < lives)
{
with(this["lives_mc" + tt])
{
_visible = true;
_x = 320 - (lives + 1) * x_size * 0.2 + tt * x_size * 0.4;
}
tt++;
}
}
function setup_Ball(tt)
{
veld_mc["ball_mc" + tt]._alpha = 100;
veld_mc["bshad_mc" + tt]._alpha = 100;
veld_mc["ball_mc" + tt]._y = 500;
veld_mc["bshad_mc" + tt]._y = 500;
bx[tt] = rand_Range(120,520);
by[tt] = rand_Range(480,520);
if(rand_Range(0,1) == 0)
{
aa[tt] = rand_Range(15,75);
}
else
{
aa[tt] = rand_Range(285,345);
}
bspeed[tt] = 4 + tt / 2;
b_dx[tt] = bspeed[tt] * Math.sin(aa[tt] * 3.141592653589793 / 180);
b_dy[tt] = (- bspeed[tt]) * Math.cos(aa[tt] * 3.141592653589793 / 180);
bmax[tt] = rand_Range(6,12);
bbounce[tt] = rand_Range(0,bmax[tt]);
bframe[tt] = rand_Range(0,20);
}
function setup_Player()
{
with(player_mc)
{
_x = rand_Range(40,330);
_y = rand_Range(24,176);
_xscale = 100;
_yscale = 100;
var dx = - dia;
var dy = dia;
_alpha = 100;
player_mc.hoek = 0;
}
pshadow_mc._alpha = 100;
}
function new_naam()
{
with(naam_mc)
{
txt.text = bword;
_xscale = 100;
_yscale = 100;
_y = 448;
_x = 320 - _width / 2;
_visible = false;
_alpha = 0;
}
if(bonus > 3)
{
bonus = 0;
}
}
function add_back(ww, hh, target_mc)
{
with(target_mc)
{
lineStyle(1,16777215,0);
beginFill(16777215,0);
moveTo(0,0);
lineTo(ww,0);
lineTo(ww,hh);
lineTo(0,hh);
lineTo(0,0);
endFill();
}
}
function setup_Game()
{
score = 0;
fcount = 0;
score_count = 0;
level_count = 0;
num = 1;
key_count = 0;
wplayer = 0;
oplayer = 0;
shield_count = 0;
speed_count = 0;
freeze_count = 0;
hunt_count = 0;
boost_count = 0;
lives = 3;
goal = 0;
hunt = 0;
if(chal == 4)
{
dia = 4.8;
}
else
{
dia = 4;
}
start_time = getTimer();
cur_time = 0;
if(niv > 4)
{
niv = 2;
switch(chal)
{
case 1:
num = 5;
chal_txt.text = "1:00";
break;
case 2:
name_count = 0;
chal_txt.text = "0 / 5";
break;
case 3:
ball_count = 0;
chal_txt.text = "0 / 10";
break;
case 4:
chal_txt.text = "5:00";
break;
case 5:
break;
case 6:
chal_txt.text = "0 / 25";
}
chal_txt._visible = true;
}
if(chal == 0)
{
hi_txt.text = soc_so.data["hi_Score" + niv];
}
else
{
hi_txt.text = soc_so.data["hi_Score" + (chal + 3)];
}
}
function end_Game()
{
stop_mc._visible = false;
player_mc._alpha = 0;
player_mc.bar_mc._visible = false;
player_mc.effect1_mc._visible = false;
player_mc.effect2_mc._visible = false;
player_mc.effect3_mc._visible = false;
player_mc.effect4_mc._visible = false;
chal_txt._visible = false;
hit_mc._alpha = 0;
bonus_hit_mc._alpha = 0;
goal_hit_mc._alpha = 0;
hunt_hit_mc._alpha = 0;
pshadow_mc._alpha = 0;
tt = 0;
while(tt < _root.num)
{
veld_mc["ball_mc" + tt]._alpha = 0;
veld_mc["bshad_mc" + tt]._alpha = 0;
tt++;
}
tt = 0;
while(tt < _root.bword.length)
{
this["bonus_mc" + tt]._visible = false;
tt++;
}
tt = 0;
while(tt < 10)
{
this["lives_mc" + tt]._visible = false;
tt++;
}
boost_mc._visible = false;
}
var cur_frame = "Setup";
var Mfloor = Math.floor;
var x_pos;
var y_pos;
var pw = 50.5;
var ph = 41.5;
var bw = 16.5;
var bh = 16;
var xmin = 40;
var xmax = 600;
var ymin = 16;
var ymax = 408;
var playerData = flash.display.BitmapData.loadBitmap("playersBitmap");
var playerFrame = new flash.display.BitmapData(pw,ph,true,6710784);
var ballData = flash.display.BitmapData.loadBitmap("ballBitmap");
var ballFrame = new flash.display.BitmapData(bw,bh,true,6710784);
var dropShadow = new flash.filters.DropShadowFilter(-5,45,0,0.75,4,4,1,2,false,false,true);
var dropShadow2 = new flash.filters.DropShadowFilter(4,45,0,0.75,4,4,1,2,false,false,false);
var dropShadow3 = new flash.filters.DropShadowFilter(5,45,0,0.5,5,5,1,2,false,false,false);
var bevel = new flash.filters.BevelFilter(2,75,16777215,0.8,0,0.8,2,2,1,3,"inner",false);
var edge_glow = new flash.filters.GlowFilter(16777215,0.5,2,2,2,2,false,false);
var score = 0;
var fcount = 0;
var score_count = 0;
var level_count = 0;
var num = 1;
var zoom = 0.8;
var x_size = pw * zoom;
var y_size = ph * zoom;
var bx_size = bw * zoom;
var by_size = bh * zoom;
var dia = 4;
var myMatrix = new flash.geom.Matrix(zoom,0,0,zoom);
var skewMatrix = new flash.geom.Matrix(zoom,0,0.5,zoom);
var myColorTransform = new flash.geom.ColorTransform();
var myRectangle = new flash.geom.Rectangle(fcount * pw,ph / 2,fcount * pw + pw,ph);
var red_Glow = new flash.filters.GlowFilter(16711680,1,4,4,2,2,false,false);
counter_txt.filters = new Array(edge_glow,dropShadow2);
hi_txt.filters = new Array(edge_glow,dropShadow2);
chal_txt.filters = new Array(edge_glow,dropShadow2);
counter_txt.selectable = false;
hi_txt.selectable = false;
chal_txt.selectable = false;
var key_count = 0;
var wplayer = 0;
var oplayer = 0;
var niv = 2;
var shield_count = 0;
var speed_count = 0;
var freeze_count = 0;
var hunt_count = 0;
var boost_count = 0;
var goal = 0;
var hunt = 0;
var chal = 0;
var start_time = 0;
var cur_time = 0;
var name_count = 0;
var ball_count = 0;
var move_type = 4;
this.attachMovie("snd_but","sound_but",this.getNextHighestDepth());
tt = 0;
while(tt < 10)
{
this.createEmptyMovieClip("lives_mc" + tt,50 + tt);
tt++;
}
this.createEmptyMovieClip("hit_mc",10000);
tt = 0;
while(tt < 64)
{
veld_mc.createEmptyMovieClip("ball_mc" + tt,1001 + tt * 2);
veld_mc.createEmptyMovieClip("bshad_mc" + tt,1000 + tt * 2);
tt++;
}
this.createEmptyMovieClip("player_mc",901);
this.createEmptyMovieClip("pshadow_mc",900);
this.createEmptyMovieClip("boost_mc",560);
tt = 0;
while(tt < 32)
{
this.createEmptyMovieClip("bonus_mc" + tt,500 + tt);
tt++;
}
this.createEmptyMovieClip("naam_mc",550);
this.createEmptyMovieClip("bonus_hit_mc",5000);
this.createEmptyMovieClip("goal_hit_mc",5001);
this.createEmptyMovieClip("hunt_hit_mc",5002);
this.createEmptyMovieClip("message_mc",6000);
with(sound_but)
{
_x = 320;
_y = 2;
sound_but.onRelease = function()
{
if(snd_txt.text == "Sound On")
{
snd_txt.text = "Sound Off";
_root.loop_sound.start();
_root.sound_on = true;
}
else
{
snd_txt.text = "Sound On";
_root.loop_sound.stop();
_root.sound_on = false;
}
};
}
this.attachMovie("succes","succes_mc",888);
succes_mc._visible = false;
succes_mc._x = 160;
succes_mc._y = 120;
var chal_succes = false;
var players = new Array("Jan Ceulemans","Franky van der Elst","Jean-Marie Pfaff","Marco van Basten","Dennis Bergkamp","Johan Cruijff","Edgar Davids","Ruud Gullit","René van de Kerkhof","Willy van de Kerkhof","Patrick Kluivert","Johan Neeskens","Ruud van Nistelrooy","Rob Rensenbrink","Frank Rijkaard","Clarence Seedorf","Gabriel Batistuta","Hernán Jorge Crespo","Mario Kempes","Diego Maradona","Daniel Passarella","Javier Saviola","Omar Sivori","Alfredo Di Stéfano","Juan Sebastián Verón","Javier Zanetti","Carlos Alberto Torres","Cafú","Roberto Carlos","Falcão","Júnior","Pelé","Rivaldo","Rivelino","Romário","Ronaldinho","Ronaldo","Djalma Santos","Nilton Santos","Sócrates","Zico","Hristo Stoichkov","Elias Figueroa","Iván Zamorano","Carlos Valderrama","Brian Laudrup","Michael Laudrup","Peter Schmeichel","Michael Ballack","Franz Beckenbauer","Paul Breitner","Oliver Kahn","Jürgen Klinsmann","Sepp Maier","Lothar Matthäus","Gerd Müller","Karl-Heinz Rummenigge","Uwe Seeler","Gordon Banks","David Beckham","Bobby Charlton","Kevin Keegan","Gary Lineker","Michael Owen","Alan Shearer","Eric Cantona","Marcel Desailly","Didier Deschamps","Just Fontaine","Thierry Henry","Raymond Kopa","Jean-Pierre Papin","Robert Pires","Michel Platini","Lilian Thuram","Marius Trésor","David Trezeguet","Patrick Vieira","Zinédine Zidane","Abédi Pelé","Ferenc Puskas","Roy Keane","Roberto Baggio","Franco Baresi","Giuseppe Bergomi","Giampero Boniperti","Gianluigi Buffon","Giacinto Facchetti","Paolo Maldini","Alessandro Nesta","Alessandro Del Piero","Gianni Rivera","Paolo Rossi","Francesco Totti","Christian Vieri","Dino Zoff","Hidetoshi Nakata","Roger Milla","Davor Suker","George Weah","Hugo Sánchez","Augustine Okocha","George Best","Andriy Shevchenko","Romerito","Teofilo Cubillas","Zbigniew Boniek","Manuel Rui Costa","Eusébio","Luis Figo","Gheorghe Hagi","Rinat Dasajev","Kenny Dalglish","El-Hadji Diouf","Emilio Butragueño","Luis Enrique","Raúl","Josef Masopust","Pavel Nedved","Emre Belözoğlu","Rüstü Reçber","Enzo Francescoli","Michelle Akers","Mia Hamm","Hong Myung-Bo");
var soc_so = SharedObject.getLocal("SoccoFobia2.0_HighScore");
var tt = 1;
while(tt < 20)
{
if(soc_so.data["hi_Score" + tt] == undefined)
{
soc_so.data["hi_Score" + tt] = new Number();
soc_so.data["hi_Score" + tt] = 0;
}
hi_txt.text = soc_so.data.hi_Score1;
tt++;
}
var mess_fmt = new TextFormat();
with(mess_fmt)
{
font = "Impact";
size = 40;
color = 16777215;
align = "center";
}
tt = 0;
while(tt < 10)
{
with(this["lives_mc" + tt])
{
_x = 320 - (lives + 1) * x_size * 0.2 + tt * x_size * 0.4;
_y = 424;
var playerBitmap = new flash.display.BitmapData(x_size * 0.8,y_size * 0.8,true,11154244);
playerFrame.copyPixels(playerData,new flash.geom.Rectangle(0,2 * ph,pw,3 * ph),new flash.geom.Point(0,0));
playerBitmap.draw(playerFrame,new flash.geom.Matrix(zoom * 0.8,0,0,zoom * 0.8),myColorTransform,"normal",new flash.geom.Rectangle(0,0,x_size,y_size),true);
this["lives_mc" + tt].attachBitmap(playerBitmap,1);
playerBitmap.dispose;
filters = new Array(dropShadow2);
_visible = false;
}
tt++;
}
var lives = 3;
var hit_matrix = {a:40,b:0,c:0,d:0,e:30,f:0,g:20,h:15,i:8};
with(hit_mc)
{
var hx;
var hy;
var cx;
var cy;
var vv = 6;
beginGradientFill("radial",[16777060,16752640],[100,100],[0,255],hit_matrix,"spread","linearRGB",0);
lineStyle(1,0,100);
hx = 20;
hy = 30;
moveTo(hx,hy);
tt = 1;
while(tt < vv * 2 + 1)
{
cx = 20 + 10 * Math.sin((tt - 0.5) * 3.141592653589793 / vv);
cy = 15 + 7.5 * Math.cos((tt - 0.5) * 3.141592653589793 / vv);
hx = 20 + 20 * Math.sin(tt * 3.141592653589793 / vv);
hy = 15 + 15 * Math.cos(tt * 3.141592653589793 / vv);
curveTo(cx,cy,hx,hy);
tt++;
}
endFill();
vv = 4;
beginGradientFill("radial",[16744448,16711680],[100,100],[0,255],hit_matrix,"spread","linearRGB",0);
hx = 20;
hy = 22.5;
moveTo(hx,hy);
tt = 1;
while(tt < vv * 2 + 1)
{
cx = 20 + 5 * Math.sin((tt - 0.5) * 3.141592653589793 / vv);
cy = 15 + 3.75 * Math.cos((tt - 0.5) * 3.141592653589793 / vv);
hx = 20 + 10 * Math.sin(tt * 3.141592653589793 / vv);
hy = 15 + 7.5 * Math.cos(tt * 3.141592653589793 / vv);
curveTo(cx,cy,hx,hy);
tt++;
}
endFill();
_alpha = 0;
}
var tt;
var b_dx = Array(64);
var b_dy = Array(64);
var bx = Array(64);
var by = Array(64);
var aa = Array(64);
var bbounce = Array(64);
var bframe = Array(64);
var bmax = Array(64);
var bspeed = Array(64);
tt = 0;
while(tt < 64)
{
with(veld_mc["ball_mc" + tt])
{
_xscale = 100;
_yscale = 100;
_x = 160;
_y = 160;
}
with(veld_mc["bshad_mc" + tt])
{
_xscale = 150;
_yscale = 25;
}
tt++;
}
setup_Balls = function()
{
tt = 0;
while(tt < 64)
{
setup_Ball(tt);
tt++;
}
};
player_mc._x = -100;
with(pshadow_mc)
{
_xscale = 150;
_yscale = 25;
}
var rr = rand_Range(0,7);
var fx1_glow = new flash.filters.GlowFilter(16777215,0.75,5,5,2,2,false,false);
var cc = 0;
player_mc.createEmptyMovieClip("effect1_mc",11);
with(player_mc.effect1_mc)
{
lineStyle(1,16777024,75);
beginFill(16777120,10);
var tt = 0;
while(tt < 12)
{
var tx = 20 * Math.sin(tt * 3.141592653589793 / 6);
var ty = 20 * Math.cos(tt * 3.141592653589793 / 6);
draw_Circle(tx,ty,2,player_mc.effect1_mc);
tt++;
}
endFill();
_x = 21;
_y = 16;
filters = new Array(fx1_glow);
player_mc.effect1_mc.onEnterFrame = function()
{
this._rotation += 6;
};
_visible = false;
}
var fx2_glow = new flash.filters.GlowFilter(16752640,0.75,5,5,2,2,false,false);
player_mc.createEmptyMovieClip("effect2_mc",12);
with(player_mc.effect2_mc)
{
lineStyle(2,16711680,75);
var tt = 0;
while(tt < 8)
{
var tx = 16 * Math.sin((tt - 0.25) * 3.141592653589793 / 4);
var ty = 16 * Math.cos((tt - 0.25) * 3.141592653589793 / 4);
moveTo(tx,ty);
var tx = 20 * Math.sin(tt * 3.141592653589793 / 4);
var ty = 20 * Math.cos(tt * 3.141592653589793 / 4);
lineTo(tx,ty);
moveTo(tx * 0.6,ty * 0.6);
lineTo(tx,ty);
var tx = 16 * Math.sin((tt + 0.25) * 3.141592653589793 / 4);
var ty = 16 * Math.cos((tt + 0.25) * 3.141592653589793 / 4);
lineTo(tx,ty);
tt++;
}
_x = 21;
_y = 16;
_xscale = 120;
_yscale = 120;
filters = new Array(fx2_glow);
player_mc.effect2_mc.onEnterFrame = function()
{
this._rotation += 8;
this._alpha = 70 - 30 * Math.sin(_root.cc * 3.141592653589793 / 13.5);
_root.cc = _root.cc + 1;
};
_visible = false;
}
var fx3_glow = new flash.filters.GlowFilter(8433919,0.25,2,2,2,2,false,false);
player_mc.createEmptyMovieClip("effect3_mc",13);
with(player_mc.effect3_mc)
{
lineStyle(2,12640511,75);
var tt = 0;
while(tt < 6)
{
var tx = 20 * Math.sin(tt * 3.141592653589793 / 3);
var ty = 20 * Math.cos(tt * 3.141592653589793 / 3);
var kk = 0;
while(kk < 3)
{
var kx = 4 * Math.sin(kk * 3.141592653589793 / 3);
var ky = 4 * Math.cos(kk * 3.141592653589793 / 3);
moveTo(tx - kx,ty - ky);
lineTo(tx + kx,ty + ky);
kk++;
}
tt++;
}
_x = 21;
_y = 16;
filters = new Array(fx3_glow);
player_mc.effect3_mc.onEnterFrame = function()
{
this._rotation -= 4;
};
_visible = false;
}
var fx4_glow = new flash.filters.GlowFilter(16776960,0.5,2,2,2,2,false,false);
player_mc.createEmptyMovieClip("effect4_mc",14);
with(player_mc.effect4_mc)
{
lineStyle(1,16744448,75);
beginFill(16711680,15);
var tt = 0;
while(tt < 12)
{
var tx = 20 * Math.sin(tt * 3.141592653589793 / 6);
var ty = 20 * Math.cos(tt * 3.141592653589793 / 6);
var kx = 20 * Math.sin((tt + 1) * 3.141592653589793 / 6);
var ky = 20 * Math.cos((tt + 1) * 3.141592653589793 / 6);
if(tt == 0)
{
moveTo(tx,ty);
}
curveTo((tx + kx) * 0.3,(ty + ky) * 0.3,kx,ky);
tt++;
}
endFill();
_x = 21;
_y = 16;
_xscale = 120;
_yscale = 120;
filters = new Array(fx2_glow);
player_mc.effect4_mc.onEnterFrame = function()
{
this._rotation -= 6;
};
_visible = false;
}
player_mc.createEmptyMovieClip("bar_mc",100);
with(player_mc.bar_mc)
{
_x = 8;
_y = 32;
_visible = false;
filters = new Array(dropShadow3);
}
var bonus = 0;
var bword = "SoccoFobia";
var boost = 0;
var bonus_fmt = new TextFormat();
with(bonus_fmt)
{
font = "Courier New";
bold = true;
size = 24;
color = 16760896;
align = "center";
}
tt = 0;
while(tt < 32)
{
with(this["bonus_mc" + tt])
{
createTextField("bonus_txt",this.getNextHighestDepth(),0,0,24,32);
with(bonus_txt)
{
setNewTextFormat(bonus_fmt);
selectable = false;
text = bword.substr(tt,1);
}
filters = new Array(bevel,dropShadow2);
_visible = false;
}
tt++;
}
var bonus_count;
setup_Bonus = function()
{
with(this["bonus_mc" + bonus])
{
_visible = true;
_alpha = 100;
do
{
_x = rand_Range(80,560) - 12;
_y = rand_Range(64,376) - 12;
}
while(flash.geom.Point.distance(new flash.geom.Point(_x,_y),new flash.geom.Point(player_mc._x,player_mc._y)) < 120);
}
bonus_count = 0;
if(!(_root.player_mc.bar_mc._visible == false & bonus > 0))
{
}
boost = limit(rand_Range(1,4),1,4);
if(chal == 3 & boost < 5)
{
boost = 4;
}
if(chal == 4 & boost < 5)
{
boost = 2;
}
if(chal == 5)
{
boost = 0;
boost = rand_Range(1,4);
}
switch(boost)
{
case 1:
boost_mc.attachMovie("pil1_mc","pic",1);
break;
case 2:
boost_mc.attachMovie("pil2_mc","pic",1);
break;
case 3:
boost_mc.attachMovie("pil3_mc","pic",1);
break;
case 4:
boost_mc.attachMovie("pil4_mc","pic",1);
break;
default:
boost_mc.attachMovie("","pic",1);
}
continue loop0;
};
with(naam_mc)
{
createTextField("txt",this.getNextHighestDepth(),0,0,320,32);
with(txt)
{
setNewTextFormat(bonus_fmt);
selectable = false;
text = bword;
}
filters = new Array(bevel,dropShadow2);
_visible = false;
}
new_Bonus = function()
{
var tt = 0;
while(tt < bword.length)
{
this["bonus_mc" + tt]._visible = false;
tt++;
}
oplayer = wplayer;
while(wplayer == oplayer)
{
wplayer = rand_Range(0,players.length);
}
bword = players[wplayer];
var tt = 0;
while(tt < bword.length)
{
with(this["bonus_mc" + tt])
{
_alpha = 100;
with(bonus_txt)
{
text = bword.substr(tt,1);
}
}
tt++;
}
bonus = 0;
};
var bhit_fmt = new TextFormat();
with(bhit_fmt)
{
font = "Courier New";
bold = true;
size = 16;
color = 16769056;
align = "center";
}
with(bonus_hit_mc)
{
createTextField("bonus_hit_txt",this.getNextHighestDepth(),0,0,48,24);
with(bonus_hit_txt)
{
setNewTextFormat(bhit_fmt);
selectable = false;
text = "100";
}
_visible = false;
_alpha = 0;
filters = new Array(bevel,dropShadow2);
}
with(goal_hit_mc)
{
createTextField("goal_hit_txt",this.getNextHighestDepth(),0,0,64,24);
with(goal_hit_txt)
{
setNewTextFormat(bhit_fmt);
selectable = false;
text = "1000";
}
_visible = false;
_alpha = 0;
_xscale = 120;
_yscale = 120;
filters = new Array(bevel,dropShadow2);
}
with(hunt_hit_mc)
{
createTextField("hunt_hit_txt",this.getNextHighestDepth(),0,0,64,24);
with(hunt_hit_txt)
{
setNewTextFormat(bhit_fmt);
selectable = false;
text = "1000";
}
_visible = false;
_alpha = 0;
_xscale = 120;
_yscale = 120;
filters = new Array(bevel,dropShadow2);
}
draw_Player = function()
{
var playerBitmap = new flash.display.BitmapData(x_size,y_size,true,11154244);
var shadowBitmap = new flash.display.BitmapData(x_size,y_size,true,11154244);
with(player_mc)
{
playerFrame.copyPixels(playerData,new flash.geom.Rectangle(fcount * pw,rr * ph,fcount * pw + pw,rr * ph + ph),new flash.geom.Point(0,0));
playerBitmap.draw(playerFrame,myMatrix,myColorTransform,"normal",new flash.geom.Rectangle(0,0,x_size,y_size),true);
shadowBitmap.draw(playerFrame,skewMatrix,myColorTransform,"normal",new flash.geom.Rectangle(0,0,x_size,y_size),true);
if(_root.move_type <= 2)
{
if(rr == 7 || rr == 0 || rr == 1)
{
dx = dia;
}
else if(rr == 3 || rr == 4 || rr == 5)
{
dx = - dia;
}
else
{
dx = 0;
}
if(rr == 1 || rr == 2 || rr == 3)
{
dy = dia;
}
else if(rr == 5 || rr == 6 || rr == 7)
{
dy = - dia;
}
else
{
dy = 0;
}
if(rr % 2 > 0)
{
dx = dx * 1.4142135623730951 / 2;
dy = dy * 1.4142135623730951 / 2;
}
_x += dx;
_y += dy;
if(_x < _root.xmin)
{
dx = Math.abs(dx);
}
if(_x > _root.xmax - x_size)
{
dx = - Math.abs(dx);
}
if(_y < _root.ymin)
{
dy = Math.abs(dy);
}
if(_y > _root.ymax - y_size)
{
dy = - Math.abs(dy);
}
if(dy == 0 && dx > 0)
{
rr = 0;
}
if(dy > 0 && dx > 0)
{
rr = 1;
}
if(dy > 0 && dx == 0)
{
rr = 2;
}
if(dy > 0 && dx < 0)
{
rr = 3;
}
if(dy == 0 && dx < 0)
{
rr = 4;
}
if(dy < 0 && dx < 0)
{
rr = 5;
}
if(dy < 0 && dx == 0)
{
rr = 6;
}
if(dy < 0 && dx > 0)
{
rr = 7;
}
}
if(move_type >= 3)
{
hoek = (hoek + 360) % 360;
rr = Math.floor(hoek / 45 + 0.5) % 8;
dx = dia * Math.cos(hoek * 3.141592653589793 / 180);
dy = dia * Math.sin(hoek * 3.141592653589793 / 180);
_x += dx;
_y += dy;
if(_x < _root.xmin)
{
hoek = (hoek + rand_Range(90,270)) % 360;
_x = _root.xmin;
}
if(_x > _root.xmax - x_size)
{
hoek = (hoek + rand_Range(90,270)) % 360;
_x = _root.xmax - x_size;
}
if(_y < _root.ymin)
{
hoek = (hoek + rand_Range(90,270)) % 360;
_y = _root.ymin;
}
if(_y > _root.ymax - y_size)
{
hoek = (hoek + rand_Range(90,270)) % 360;
_y = _root.ymax - y_size;
}
}
attachBitmap(playerBitmap,1);
}
with(pshadow_mc)
{
_x = player_mc._x - pw * zoom;
_y = player_mc._y + zoom * 0.75 * ph;
attachBitmap(shadowBitmap,1);
filters = new Array(dropShadow);
}
playerBitmap.dispose;
shadowBitmap.dispose;
fcount++;
if(fcount > 9)
{
fcount = 0;
}
};
draw_Ball = function(tt)
{
var ballBitmap = new flash.display.BitmapData(bx_size,by_size,true,11154244);
var bshadowBitmap = new flash.display.BitmapData(bx_size,by_size,true,11154244);
with(veld_mc["ball_mc" + tt])
{
ballFrame.copyPixels(ballData,new flash.geom.Rectangle(bframe[tt] * bw,0,bframe[tt] * bw + bw,bh),new flash.geom.Point(0,0));
ballBitmap.draw(ballFrame,myMatrix,myColorTransform,"normal",new flash.geom.Rectangle(0,0,bx_size,by_size),true);
bshadowBitmap.draw(ballFrame,skewMatrix,myColorTransform,"normal",new flash.geom.Rectangle(0,0,bx_size,by_size),true);
if(freeze_count == 0)
{
bx[tt] += b_dx[tt];
by[tt] += b_dy[tt];
}
if(bx[tt] <= _root.xmin + 8 || bx[tt] >= _root.xmax - 8 - _width)
{
aa[tt] = 360 - aa[tt];
b_dx[tt] = bspeed[tt] * Math.sin(aa[tt] * 3.141592653589793 / 180);
b_dy[tt] = (- bspeed[tt]) * Math.cos(aa[tt] * 3.141592653589793 / 180);
}
if(by[tt] < _root.ymin + 8 || by[tt] > _root.ymax - by_size && aa[tt] > 90 && aa[tt] < 270)
{
if(aa[tt] < 180)
{
aa[tt] = 180 - aa[tt];
}
else
{
aa[tt] = 540 - aa[tt];
}
b_dx[tt] = bspeed[tt] * Math.sin(aa[tt] * 3.141592653589793 / 180);
b_dy[tt] = (- bspeed[tt]) * Math.cos(aa[tt] * 3.141592653589793 / 180);
}
_x = bx[tt];
_y = by[tt] - 8 * Math.sin(bbounce[tt] * 3.141592653589793 / bmax[tt]);
attachBitmap(ballBitmap,1);
}
with(veld_mc["bshad_mc" + tt])
{
_x = bx[tt] - bw / 3 * zoom;
_y = by[tt] + zoom * bh;
attachBitmap(bshadowBitmap,1);
filters = new Array(dropShadow);
}
if(b_dx[tt] > 0)
{
bframe[tt]++;
if(bframe[tt] > 29)
{
bframe[tt] = 0;
}
}
if(b_dx[tt] < 0)
{
bframe[tt]--;
if(bframe[tt] < 0)
{
bframe[tt] = 29;
}
}
bbounce[tt]++;
if(bbounce[tt] >= bmax[tt])
{
bbounce[tt] = 0;
}
ballBitmap.dispose;
bshadowBitmap.dispose;
};
swap_Val = function(v1, v2)
{
var _loc1_ = v1;
v1 = v2;
v2 = _loc1_;
};
var r_right = false;
var r_left = false;
var r_up = false;
var r_down = false;
var keyListener = new Object();
keyListener.onKeyDown = function()
{
if(key_count <= 0 || move_type == 2)
{
if(move_type == 1)
{
var _loc3_ = rr;
if(Key.isDown(39))
{
rr = 0;
}
else if(Key.isDown(34))
{
rr = 1;
}
else if(Key.isDown(40))
{
rr = 2;
}
else if(Key.isDown(35))
{
rr = 3;
}
else if(Key.isDown(37))
{
rr = 4;
}
else if(Key.isDown(36))
{
rr = 5;
}
else if(Key.isDown(38))
{
rr = 6;
}
else if(Key.isDown(33))
{
rr = 7;
}
if(Key.getCode() == 68 || Key.getCode() == 100)
{
rr = 0;
}
else if(Key.getCode() == 67 || Key.getCode() == 99)
{
rr = 1;
}
else if(Key.getCode() == 88 || Key.getCode() == 120)
{
rr = 2;
}
else if(Key.getCode() == 90 || Key.getCode() == 122)
{
rr = 3;
}
else if(Key.getCode() == 65 || Key.getCode() == 97)
{
rr = 4;
}
else if(Key.getCode() == 81 || Key.getCode() == 113)
{
rr = 5;
}
else if(Key.getCode() == 87 || Key.getCode() == 119)
{
rr = 6;
}
else if(Key.getCode() == 69 || Key.getCode() == 101)
{
rr = 7;
}
}
if(move_type == 2)
{
_loc3_ = rr;
if(Key.isDown(39) || Key.getCode() == 68 || Key.getCode() == 100)
{
r_right = true;
}
if(Key.isDown(40) || Key.getCode() == 83 || Key.getCode() == 115)
{
r_down = true;
}
if(Key.isDown(37) || Key.getCode() == 65 || Key.getCode() == 97)
{
r_left = true;
}
if(Key.isDown(38) || Key.getCode() == 87 || Key.getCode() == 119)
{
r_up = true;
}
if(r_right == true)
{
rr = 0;
if(r_down == true)
{
rr = 1;
}
if(r_up == true)
{
rr = 7;
}
}
else if(r_left == true)
{
rr = 4;
if(r_down == true)
{
rr = 3;
}
if(r_up == true)
{
rr = 5;
}
}
else if(r_down == true)
{
rr = 2;
}
else if(r_up == true)
{
rr = 6;
}
}
if(move_type == 3)
{
var _loc2_ = 5;
if(Key.isDown(16))
{
_loc2_ = 15;
}
if(Key.isDown(39) || Key.getCode() == 68 || Key.getCode() == 100)
{
_root.player_mc.hoek += _loc2_;
}
if(Key.isDown(37) || Key.getCode() == 65 || Key.getCode() == 97)
{
_root.player_mc.hoek -= _loc2_;
}
_root.player_mc.hoek = (_root.player_mc.hoek + 360) % 360;
}
if(player_mc._x > _root.xmin + 8 & player_mc._x < _root.xmax - 8 - x_size & player_mc._y > _root.ymin + 8 & player_mc._y < _root.ymax - 8 - y_size)
{
key_count = 2;
}
else
{
if(move_type != 2)
{
key_count = 10;
}
rr = _loc3_;
}
}
};
keyListener.onKeyUp = function()
{
if(move_type == 2)
{
if(Key.getCode() == 39 || Key.getCode() == 68 || Key.getCode() == 100)
{
r_right = false;
}
if(Key.getCode() == 40 || Key.getCode() == 83 || Key.getCode() == 115)
{
r_down = false;
}
if(Key.getCode() == 37 || Key.getCode() == 65 || Key.getCode() == 97)
{
r_left = false;
}
if(Key.getCode() == 38 || Key.getCode() == 87 || Key.getCode() == 119)
{
r_up = false;
}
}
};
Key.addListener(keyListener);
var mouseListener = new Object();
mouseListener.onMouseMove = function()
{
if(get_Distance(_ymouse - player_mc._y - y_size / 2,_xmouse - player_mc._x - x_size / 2) > 32)
{
var _loc1_ = Math.atan2(_ymouse - player_mc._y - y_size / 2,_xmouse - player_mc._x - x_size / 2);
if(move_type == 4)
{
player_mc.hoek = (Math.floor(180 * _loc1_ / 3.141592653589793) + 360) % 360;
}
}
};
Mouse.addListener(mouseListener);
var sound_on = true;
this.attachMovie("empty","s_loop",this.getNextHighestDepth());
var loop_sound = new Sound(s_loop);
loop_sound.attachSound("MP3");
loop_sound.onSoundComplete = function()
{
loop_sound.start();
};
this.attachMovie("empty","s_hit",this.getNextHighestDepth());
var hit_sound = new Sound(s_hit);
hit_sound.attachSound("ow_mp3");
this.attachMovie("empty","s_hit2",this.getNextHighestDepth());
var hit_sound2 = new Sound(s_hit2);
hit_sound2.attachSound("oue_wav");
this.attachMovie("empty","s_bonus",this.getNextHighestDepth());
var bonus_sound = new Sound(s_bonus);
bonus_sound.attachSound("bloop2_wav");
this.attachMovie("empty","s_bonus2",this.getNextHighestDepth());
var bonus_sound2 = new Sound(s_bonus2);
bonus_sound2.attachSound("whoo_wav");
this.attachMovie("empty","s_boost",this.getNextHighestDepth());
var boost_sound = new Sound(s_boost);
boost_sound.attachSound("jos1_wav");
this.attachMovie("empty","s_goal",this.getNextHighestDepth());
var goal_sound = new Sound(s_goal);
goal_sound.attachSound("tooor_wav");
goal_sound.setVolume(40);
this.attachMovie("empty","s_hunt",this.getNextHighestDepth());
var hunt_sound = new Sound(s_hunt);
hunt_sound.attachSound("thud_wav");
this.attachMovie("empty","s_beep",this.getNextHighestDepth());
var beep_sound = new Sound(s_beep);
beep_sound.attachSound("pc_beep_wav");
beep_sound.setVolume(40);
if(soc_so.data.move_type == undefined)
{
soc_so.data.sound_on = 1;
}
else
{
sound_on = soc_so.data.sound_on == 1;
}
trace(sound_on);
trace(sound_but.snd_txt.text);
if(sound_on == true)
{
sound_but.snd_txt.text = "Sound Off";
start_btn._visible = false;
stop_btn._visible = true;
loop_sound.start();
}
else
{
sound_but.snd_txt.text = "Sound On";
stop_btn._visible = false;
start_btn._visible = true;
}
this.attachMovie("cross_mc","stop_mc",this.getNextHighestDepth());
add_back(16,16,stop_mc);
with(stop_mc)
{
_xscale = 75;
_yscale = 75;
_x = 624;
_y = 4;
_visible = false;
stop_mc.onRelease = function()
{
_root.lives = -1;
_root.gotoAndPlay("End");
};
}
if(sound_on == true)
{
start_btn._visible = false;
stop_btn._visible = true;
loop_sound.start();
}
else
{
stop_btn._visible = false;
start_btn._visible = true;
}
var left_fmt = new TextFormat();
with(left_fmt)
{
font = "Courier New";
bold = true;
size = 20;
color = 16760896;
align = "left";
}
var right_fmt = new TextFormat();
with(right_fmt)
{
font = "Courier New";
bold = true;
size = 20;
color = 16760896;
align = "right";
}
this.createEmptyMovieClip("list_mc",this.getNextHighestDepth());
list_mc.createTextField("top_txt",list_mc.getNextHighestDepth(),52,20,80,28);
with(list_mc.top_txt)
{
setNewTextFormat(left_fmt);
selectable = false;
text = "Top-10";
filters = new Array(bevel,dropShadow2);
}
list_mc.createTextField("lev_txt",list_mc.getNextHighestDepth(),298,20,160,28);
with(list_mc.lev_txt)
{
setNewTextFormat(right_fmt);
selectable = false;
text = "Easy";
filters = new Array(bevel,dropShadow2);
}
var tt = 0;
while(tt < 10)
{
list_mc.createTextField("rank" + tt,list_mc.getNextHighestDepth(),40,48 + tt * 21,32,28);
with(list_mc["rank" + tt])
{
setNewTextFormat(right_fmt);
selectable = false;
text = tt + 1;
filters = new Array(bevel,dropShadow2);
}
list_mc.createTextField("uname" + tt,list_mc.getNextHighestDepth(),80,48 + tt * 21,200,28);
with(list_mc["uname" + tt])
{
setNewTextFormat(left_fmt);
selectable = false;
text = ". . .";
filters = new Array(bevel,dropShadow2);
}
list_mc.createTextField("uscore" + tt,list_mc.getNextHighestDepth(),288,48 + tt * 21,80,28);
with(list_mc["uscore" + tt])
{
setNewTextFormat(right_fmt);
selectable = false;
text = "0";
filters = new Array(bevel,dropShadow2);
}
tt++;
}
list_mc._visible = false;
gotoAndStop("Menu");
play();