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

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

Football & Soccer & Rugby - Best Free Kicker.swf

This is the info page for
Flash #231131

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


Text
Please wait while loading Best Free Kicker...

00%

00%

FREE    KICKER

Best

INSTRUCTIONS

Use the mouse to move the player inside the
semi circle.

Click the mouse to shoot the ball.

Check the wind direction before the shoot.

You get 10 chances to score.

PLAY

GOAL!

SAVE!

100

Score:

Level:

Chances Left:

Wind

1

10

12/12

0

Shot 1
Shot 2
Shot 3
Shot 4
Shot 5
Shot 6
Shot 7
Shot 8
Shot 9
Shot 10

0

0

0

0

0

0

0

0

0

0

SCORE CARD

RETRY

RETRY

RETRY

NEXT

NEXT

NEXT

REPLAY

REPLAY

REPLAY

GAME COMPLETE

PLAY AGAIN

Score

Chances Left x

50

Total Score

GAME   VER

Final Score

TRY AGAIN

ActionScript [AS1/AS2]

Frame 1
this.onEnterFrame = function () { var _local2 = _root.getBytesLoaded(); var _local3 = _root.getBytesTotal(); if (_local2 >= _local3) { gotoAndStop (101); } txtLoadPercentage.text = int((_local2 / _local3) * 100) + "%"; };
Frame 100
gotoAndPlay (1);
Frame 101
stop(); Stage.align = "LT"; Stage.scaleMode = "noScale"; btnPlay.onRelease = function () { gotoAndStop (103); }; btnInstructions.onRelease = function () { gotoAndStop ("instructions"); }; var bgm = new Sound(soundmovieclip); bgm.attachSound("croud"); bgm.setVolume(10); bgm.start(0, 1000); bgm.onSoundComplete = function () { trace("here"); bgm.start(0, 10000); }; var bgm9 = new Sound(); var rootMenu = new ContextMenu(); rootMenu.hideBuiltInItems(); _root.menu = rootMenu; submitpfad = ("http://yig.vo.llnwd.net/o25/kaisergames/" + _level0.pathvar) + "/flash/Games/submitscore.swf"; if (!_level0.kouid) { _level0.kouid = "no login"; } _root.createEmptyMovieClip("seContainer", 99999); _root.seContainer.loadMovie(submitpfad); _root.seContainer._alpha = 0; _root.seContainer._x = -500; _root.seContainer._y = -500;
Frame 102
stop(); this.onEnterFrame = function () { stop(); }; btnPlayButton.onRelease = function () { _root.totalScore = 0; _root.levelScore1 = 0; _root.levelScore2 = 0; _root.levelScore3 = 0; _root.levelScore4 = 0; _root.levelScore5 = 0; _root.levelScore6 = 0; _root.levelScore7 = 0; _root.levelScore8 = 0; _root.levelScore9 = 0; _root.levelScore10 = 0; gotoAndStop (103); };
Frame 103
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); _root.totalScore = 0; _root.levelScore1 = 0; _root.levelScore2 = 0; _root.levelScore3 = 0; _root.levelScore4 = 0; _root.levelScore5 = 0; _root.levelScore6 = 0; _root.levelScore7 = 0; _root.levelScore8 = 0; _root.levelScore9 = 0; _root.levelScore10 = 0; _root.numChances = 10; NUM_OBSTACLES = 3; _root.currentLevel = 1; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 104
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 4; _root.currentLevel = 2; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 105
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 4; _root.currentLevel = 3; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 106
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 4; _root.currentLevel = 4; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 107
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 5; _root.currentLevel = 5; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 108
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 4; _root.currentLevel = 6; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 109
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 5; _root.currentLevel = 7; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 110
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 6; _root.currentLevel = 8; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 111
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 6; _root.currentLevel = 9; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 112
function KickBall() { kicker_yspeed = (kickArea._y - mcKicker._y) / 6; kicker_xspeed = (kickArea._x - mcKicker._x) / 6; state_aiming = false; player_running = true; ball_accelup = 6 - (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) / 7); mcKicker.kicker.Run(); if (ball_accelup < 0) { ball_accelup = 1; } } function DistanceBetween(x1, y1, x2, y2) { return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))); } function GetObstacle(oid) { return(_root["obstacle" + oid]); } function AdjustDepths() { if (((ballShadow._y > (goalKeeper._y - 2)) && (ball.getDepth() < goalKeeper.getDepth())) || ((ballShadow._y < (goalKeeper._y - 2)) && (ball.getDepth() > goalKeeper.getDepth()))) { goalKeeper.swapDepths(ball); } } function ChanceDone() { if (!chance_done) { chance_done = true; EndOfChance(); } } function ResetItems() { ball._x = kickArea._x; ball._y = kickArea._y; ball._xscale = 100; ball._yscale = 100; ballMover._x = kickArea._x; ballMover._y = kickArea._y; ballShadow._x = kickArea._x; ballShadow._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; goalKeeper._x = goalPost._x; goalKeeper._y = goalPost._y + 4; goalKeeper.gotoAndStop(1); state_aiming = true; if (!nosounds) { bgm4.start(0, 1); } player_running = false; ball_in_play = false; kicker_xspeed = 0; kicker_yspeed = 0; ball_height = 0; ball_accelup = 0; goal_done = false; save_done = false; save_checked = false; target_follow_phase = 0; if ((DistanceBetween(_xmouse, _ymouse, kickArea._x, kickArea._y) < (kickArea._width / 2)) && (_ymouse > kickArea._y)) { hoveringAbove = true; } else { hoveringAbove = false; } i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } wind_y = 0 * Math.sin((windDirection * Math.PI) / 180); wind_x = 0.5 * Math.cos((windDirection * Math.PI) / 180); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } goalPost.gotoAndStop(1); chance_done = false; } function EndOfChance() { var _local2 = goal_done; if (_local2) { if (interval_goalDone == 0) { } if (!isDoingReplay) { _root.totalScore = _root.totalScore + currentScore; _root["levelScore" + _root.currentLevel] = currentScore; } toolBar._visible = true; toolBar.toolbarButtons.btnNextLevel._visible = true; toolBar.toolbarButtons.btnRetry._visible = false; btnNextLevel._visible = true; toolBar.gotoAndPlay(1); } else { if (!isDoingReplay) { _root.numChances--; } if (_root.numChances <= 0) { nosounds = true; if (interval_gameOver == 0) { interval_gameOver = setInterval(GameOver, 2000); } } else { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } trace("Setting Retry..."); interval_retry = setInterval(DoRetry, 2000); } } } function CalculateTargetX(ballx, bally, ballxspeed, ballyspeed, ylimit) { if (((ballyspeed < 0) && (bally < ylimit)) || ((ballyspeed > 0) && (bally > ylimit))) { return(-100); } if (ballyspeed < 0) { while (bally > ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } else { while (bally < ylimit) { bally = bally + ballyspeed; ballx = ballx + ballxspeed; } } return(ballx); } function DoRetry() { if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } nosounds = false; ResetItems(); } function DoReplay() { if (ball_in_play && (!goal_done)) { return(true); } if ((save_playerX == 0) && (save_playerY == 0)) { return(undefined); } if (interval_retry != 0) { clearInterval(interval_retry); interval_retry = 0; } toolBar.play(); ResetItems(); mcKicker._x = save_playerX; mcKicker._y = save_playerY; mcKicker.gotoAndStop(save_playerFrame); UpdateAngle(); isDoingReplay = true; KickBall(); } function NextLevel() { GoalDone(); } function GoalDone() { ResetItems(); nextFrame(); } function GameOver() { clearInterval(interval_gameOver); interval_gameOver = 0; gotoAndStop ("gameover"); } function UpdateAngle() { } stop(); NUM_OBSTACLES = 5; _root.currentLevel = 10; stopAllSounds(); var bgm = new Sound(); bgm.attachSound("cheer"); var bgm2 = new Sound(); bgm2.attachSound("miss"); var bgm3 = new Sound(); bgm3.attachSound("kick"); var bgm4 = new Sound(); bgm4.attachSound("whistle"); var bgm5 = new Sound(soundmovieclip2); bgm5.attachSound("ballbounce"); var bgm6 = new Sound(soundmovieclip); bgm6.attachSound("croud"); var firsttime = true; var playedsound = false; var nosounds = false; bgm5.setVolume(30); bgm6.setVolume(10); bgm6.start(0, 1000); bgm6.onSoundComplete = function () { bgm6.start(0, 10000); }; var state_aiming = true; var player_running = false; var ball_in_play = false; var chance_done = false; var hoveringAbove; var kicker_xspeed = 0; var kicker_yspeed = 0; var ball_height = 0; var ball_accelup = 0; var goal_done = false; var save_done = false; var interval_ChanceTime = 0; var target_follow_phase = 0; var interval_goalDone = 0; var interval_gameOver = 0; var interval_retry = 0; var save_checked = false; scoreCard.gotoAndStop(1); scoreCard._visible = false; var currentScore = 0; var r1 = 135; var r2 = 65; goalArea._x = goalPost._x; goalArea._y = goalPost._y; var keeper_speed = 1.5; var gravity = 0.5; var friction = 1.03; var friction_gravity = 2; var save_playerX = 0; var save_playerY = 0; var save_playerFrame = 0; var isDoingReplay = false; var windDirection = ((Math.random() * 360) - 180); mcWindDirection._rotation = windDirection; if ((mcWindDirection._rotation > 90) || (mcWindDirection._rotation < -90)) { mcWindDirection._rotation = 180; } else { mcWindDirection._rotation = 0; } var wind_y = (0 * Math.sin((windDirection * Math.PI) / 180)); var wind_x = (0.5 * Math.cos((windDirection * Math.PI) / 180)); txtWindSpeed.text = int(Math.abs(wind_x * 2) * 10) / 10; if (txtWindSpeed.text == "0") { mcWindDirection._rotation = -90; } txtLevel.text = _root.currentLevel + "/10"; ball._x = kickArea._x; ball._y = kickArea._y; ballMover._visible = false; extremeborder._visible = false; flashAlerts.gotoAndStop(1); flashAlerts._visible = false; targetMarker._visible = false; var mouseMoveLock = true; toolBar.gotoAndStop(1); btnNextLevel._visible = false; i = 0; while (i < NUM_OBSTACLES) { GetObstacle(i).gotoAndStop(1); i++; } goalPost.gotoAndStop(1); kickArea.onRollOver = function () { hoveringAbove = true; }; kickArea.onDragOver = function () { hoveringAbove = true; }; ResetItems(); kickArea.onMouseMove = function () { if (!mouseMoveLock) { hoveringAbove = true; mouseMoveLock = true; } }; kickArea.onRollOut = function () { hoveringAbove = false; }; kickArea.onDragOut = function () { hoveringAbove = false; }; kickArea.onRelease = function () { if (state_aiming) { save_playerX = mcKicker._x; save_playerY = mcKicker._y; save_playerFrame = mcKicker._currentframe; isDoingReplay = false; KickBall(); } }; this.onEnterFrame = function () { if (!state_aiming) { if (player_running) { mcKicker._x = mcKicker._x + kicker_xspeed; mcKicker._y = mcKicker._y + kicker_yspeed; if (DistanceBetween(mcKicker._x, mcKicker._y, kickArea._x, kickArea._y) <= 5) { player_running = false; mcKicker.kicker.gotoAndStop(1); ball_in_play = true; bgm3.start(0, 1); ball_accelup = 6; targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); } return(undefined); } if (ball_in_play) { ballMover._x = ballMover._x + kicker_xspeed; ballMover._y = ballMover._y + kicker_yspeed; ball._rotation = ball._rotation + (kicker_xspeed * 10); ball_height = ball_height + ball_accelup; ball_accelup = ball_accelup - gravity; if ((((ball_height > 3) && (ball_height < 8)) && (!playedsound)) && (ball_height < 6)) { playedsound = true; bgm5.start(0, 1); } if ((ball_accelup < 0) && (ball_height < 0)) { playedsound = false; ball_height = 0; ball_accelup = -(ball_accelup / friction_gravity); wind_x = wind_x / 5; wind_y = wind_y / 5; if (Math.abs(ball_accelup) <= 1) { ball_accelup = 0; ball_height = 0; } } kicker_xspeed = kicker_xspeed / friction; kicker_yspeed = kicker_yspeed / friction; kicker_xspeed = kicker_xspeed + wind_x; kicker_yspeed = kicker_yspeed + wind_y; if (Math.abs(kicker_xspeed) < 0.1) { kicker_xspeed = 0; } if (Math.abs(kicker_yspeed) < 0.1) { kicker_yspeed = 0; } if ((Math.abs(kicker_xspeed) < 1) && (Math.abs(kicker_yspeed) < 1)) { kicker_xspeed = 0; kicker_yspeed = 0; if (!chance_done) { ChanceDone(); } } if (((ball._x > Stage.width) || (ball._x < 0)) || (ball._y > Stage.height)) { if ((!chance_done) && (!goal_done)) { ChanceDone(); } } ball._x = ballMover._x; ball._y = ballMover._y - ball_height; ball._xscale = ((ballMover._y - 30) / (mcKicker._y - 30)) * 100; if (ball._xscale > 100) { ball._xscale = 100; } ball._yscale = ball._xscale; ballShadow._x = ballMover._x; ballShadow._y = ballMover._y; AdjustDepths(); if (kicker_yspeed < 0) { jumpdetectrange = Math.abs(kicker_yspeed * 6); if ((Math.abs(ballMover._y - goalKeeper._y) < jumpdetectrange) && (Math.abs(ballMover._x - goalKeeper._x) < 5)) { if (ball_height > 10) { goalKeeper.JumpDefend(); } else { goalKeeper.Defend(); } } if ((target_follow_phase == 0) && (ballMover._y < (goalKeeper._y + (((mcKicker._y - goalKeeper._y) * 2) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 1; } if ((target_follow_phase == 1) && (ballMover._y < (goalKeeper._y + ((mcKicker._y - goalKeeper._y) / 3)))) { targetMarker._x = CalculateTargetX(ballMover._x, ballMover._y, kicker_xspeed, kicker_yspeed, targetMarker._y); target_follow_phase = 2; } if (((target_follow_phase == 2) && (!goalKeeper.isJumping())) && (Math.abs(targetMarker._x - goalKeeper._x) > 20)) { if (targetMarker._x < goalKeeper._x) { goalKeeper.JumpLeft(); } else { goalKeeper.JumpRight(); } } if (targetMarker._x < (goalKeeper._x - keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x - keeper_speed; } else { goalKeeper._x = goalKeeper._x - (keeper_speed / 2); } goalKeeper.Walk(); } else if (targetMarker._x > (goalKeeper._x + keeper_speed)) { if (!goalKeeper.isJumping()) { goalKeeper._x = goalKeeper._x + keeper_speed; } else { goalKeeper._x = goalKeeper._x + (keeper_speed / 2); } goalKeeper.Walk(); } else { goalKeeper.StopMotion(); } } else { goalKeeper.StopMotion(); } if (ballMover._y <= extremeborder._y) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 2; if (kicker_yspeed > 2) { kicker_yspeed = 2; } kicker_xspeed = kicker_xspeed / 2; wind_x = wind_x / 8; wind_y = wind_y / 8; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } } if ((((!save_done) && (!goal_done)) && (ballMover._y >= goalKeeper._y)) && ((ballMover._y + kicker_yspeed) <= goalKeeper._y)) { save_checked = true; if (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, goalKeeper)) { kicker_yspeed = Math.abs(kicker_yspeed); kicker_yspeed = kicker_yspeed / 7; if (!flashAlerts._visible) { flashAlerts._visible = true; if (!nosounds) { bgm2.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("save"); save_done = true; } wind_x = 0; wind_y = 0; } } if (((((save_checked && (!goal_done)) && (kicker_yspeed < 0)) && ((goalPost._y - ballMover._y) > 0)) && ((goalPost._y - ballMover._y) < 10)) && (ballMover.hitTest(goalArea))) { flashAlerts._visible = true; if (!nosounds) { bgm.start(0, 1); nosounds = true; } flashAlerts.gotoAndPlay("goal"); kicker_xspeed = 0; kicker_yspeed = 0.2; goalPost.gotoAndPlay(1); goal_done = true; currentScore = int(DistanceBetween(ball._x, ball._y, goalKeeper._x, goalKeeper._y)); scoreCard.scoreDisplay.txtScore.text = currentScore; scoreCard._x = ball._x + 50; scoreCard._y = ball._y; scoreCard._visible = true; scoreCard.gotoAndPlay(1); wind_x = 0; wind_y = 0; } if (kicker_yspeed < 0) { i = 0; while (i < NUM_OBSTACLES) { if ((Math.abs(GetObstacle(i)._y - ballMover._y) < 2) && (com.gskinner.sprites.CollisionDetection.checkForCollision(ball, GetObstacle(i)))) { kicker_yspeed = -kicker_yspeed; GetObstacle(i).gotoAndPlay(1); if (!nosounds) { bgm2.start(0, 1); nosounds = true; } break; } i++; } } } return(undefined); } var _local1 = Math.atan2(_ymouse - kickArea._y, _xmouse - kickArea._x); var _local2 = _local1; if (_local1 < 0) { if (_local1 < -1.5707963267949) { _local1 = -3.14159265358979; } else { _local1 = 0; } _local2 = -_local1; } mcArrow._rotation = (_local1 * 180) / Math.PI; if (_local2 > 2.51327412287183) { mcKicker.gotoAndStop(5); } else if (_local2 > 1.88495559215388) { mcKicker.gotoAndStop(4); } else if (_local2 > 1.25663706143592) { mcKicker.gotoAndStop(3); } else if (_local2 > 0.628318530717959) { mcKicker.gotoAndStop(2); } else { mcKicker.gotoAndStop(1); } if (hoveringAbove) { mcKicker._x = _xmouse; mcKicker._y = _ymouse; } else { posx = kickArea._x + (r1 * Math.cos(_local1)); posy = kickArea._y + (r2 * Math.sin(_local1)); if (Math.abs(posx - kickArea._x) < Math.abs(_xmouse - kickArea._x)) { mcKicker._x = posx; } else { mcKicker._x = _xmouse; } mcKicker._y = posy; } }; btnReplay.onRelease = function () { nosounds = true; DoReplay(); }; btnNextLevel.onRelease = function () { nosounds = false; NextLevel(); };
Frame 113
stop(); txtFinalScore.text = totalScore; txtChancesLeft.text = _root.numChances; txtTotalBonus.text = _root.numChances * 50; txtGrandTotal.text = Number(_root.totalScore) + (_root.numChances * 50); btnPlayAgain.onRelease = function () { gotoAndStop (103); }; _root.seScore = Number(_root.totalScore) + (_root.numChances * 50); _root.seContainer._alpha = 100; _root.seContainer._x = Stage.width / 2; _root.seContainer._y = Stage.height / 2; Mouse.show; nochmal.onRelease = function () { _root.gotoAndPlay(1); }; stop();
Frame 114
stop(); txtFinalScore.text = totalScore; btnTryAgain.onRelease = function () { gotoAndStop (103); }; _root.seScore = totalScore; _root.seContainer._alpha = 100; _root.seContainer._x = Stage.width / 2; _root.seContainer._y = Stage.height / 2; Mouse.show; nochmal.onRelease = function () { _root.gotoAndPlay(1); }; stop();
Symbol 13 MovieClip Frame 12
Symbol 26 MovieClip Frame 1
this.onRelease = function () { getURL ("http://www.gamezindia.com", "_blank"); };
Symbol 30 Button
on (release) { getURL ("http://www.kibagames.com", "_blank"); }
Symbol 361 MovieClip [__Packages.com.gskinner.sprites.CollisionDetection] Frame 0
class com.gskinner.sprites.CollisionDetection { function CollisionDetection () { } static function checkForCollision(p_clip1, p_clip2, p_alphaTolerance) { if (p_alphaTolerance == undefined) { p_alphaTolerance = 255; } var _local4 = p_clip1.getBounds(_root); var _local3 = p_clip2.getBounds(_root); if (((_local4.xMax < _local3.xMin) || (_local3.xMax < _local4.xMin)) || ((_local4.yMax < _local3.yMin) || (_local3.yMax < _local4.yMin))) { return(null); } var _local2 = {}; _local2.xMin = Math.max(_local4.xMin, _local3.xMin); _local2.xMax = Math.min(_local4.xMax, _local3.xMax); _local2.yMin = Math.max(_local4.yMin, _local3.yMin); _local2.yMax = Math.min(_local4.yMax, _local3.yMax); var _local7 = new flash.display.BitmapData(_local2.xMax - _local2.xMin, _local2.yMax - _local2.yMin, false); var _local5 = p_clip1.transform.concatenatedMatrix; _local5.tx = _local5.tx - _local2.xMin; _local5.ty = _local5.ty - _local2.yMin; _local7.draw(p_clip1, _local5, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, p_alphaTolerance)); _local5 = p_clip2.transform.concatenatedMatrix; _local5.tx = _local5.tx - _local2.xMin; _local5.ty = _local5.ty - _local2.yMin; _local7.draw(p_clip2, _local5, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, p_alphaTolerance), "difference"); var _local6 = _local7.getColorBoundsRect(4294967295, 4278255615); if (_local6.width == 0) { return(null); } _local6.x = _local6.x + _local2.xMin; _local6.y = _local6.y + _local2.yMin; return(_local6); } }
Symbol 65 MovieClip Frame 1
this.onRelease = function () { getURL ("http://www.gamezindia.com", "_blank"); };
Symbol 69 MovieClip Frame 1
button.onRelease = function () { trace("inside2"); _root.soundmute = false; _root.mutebutton._visible = true; _root.unmutebutton._visible = false; _root.bgm9.setVolume(80); };
Symbol 72 MovieClip Frame 1
button.onRelease = function () { trace("inside"); _root.soundmute = true; _root.mutebutton._visible = false; _root.unmutebutton._visible = true; _root.bgm9.setVolume(0); };
Symbol 92 Button
on (release) { getURL ("http://www.kibagames.com/", "_blank"); }
Symbol 98 MovieClip Frame 1
this.onRelease = function () { getURL ("http://www.kibagames.com/", "_blank"); };
Symbol 109 MovieClip Frame 8
gotoAndStop (1);
Symbol 136 MovieClip Frame 1
function Reset() { gotoAndStop (1); }
Symbol 136 MovieClip Frame 91
stop();
Symbol 231 MovieClip Frame 1
function Walk() { if (_currentframe == 1) { gotoAndPlay (2); } } function JumpRight() { if (_currentframe <= 6) { gotoAndPlay ("jumpright"); } } function JumpLeft() { if (_currentframe <= 6) { gotoAndPlay ("jumpleft"); } } function SmallJumpRight() { if (_currentframe <= 6) { gotoAndPlay ("smalljumpright"); } } function SmallJumpLeft() { if (_currentframe <= 6) { gotoAndPlay ("smalljumpleft"); } } function StopMotion() { if ((_currentframe > 1) && (_currentframe <= 6)) { gotoAndStop (1); } } function Defend() { if ((!isJumping()) && (_currentframe < 118)) { gotoAndPlay ("defend"); } } function JumpDefend() { if ((!isJumping()) && (_currentframe < 118)) { gotoAndPlay ("jumpdefend"); } } function isJumping() { if (_currentframe > 6) { return(true); } return(false); } stop();
Symbol 231 MovieClip Frame 7
gotoAndPlay (2);
Symbol 231 MovieClip Frame 47
stop();
Symbol 231 MovieClip Frame 86
stop();
Symbol 231 MovieClip Frame 100
stop();
Symbol 231 MovieClip Frame 134
gotoAndStop (1);
Symbol 231 MovieClip Frame 148
gotoAndStop (1);
Symbol 242 MovieClip Frame 20
this._visible = false; gotoAndStop (1);
Symbol 242 MovieClip Frame 40
stop(); this._visible = false;
Symbol 246 MovieClip Frame 20
stop(); this._visible = false;
Symbol 283 MovieClip Frame 1
btnReplay.onRelease = function () { _parent._parent.DoReplay(); }; btnRetry.onRelease = function () { _parent._parent.DoRetry(); }; btnNextLevel.onRelease = function () { _parent._parent.NextLevel(); };
Symbol 284 MovieClip Frame 14
stop();
Symbol 284 MovieClip Frame 28
stop(); gotoAndStop (1);
Symbol 294 MovieClip Frame 1
function Run() { gotoAndPlay (2); }
Symbol 294 MovieClip Frame 7
gotoAndPlay (2);
Symbol 298 MovieClip Frame 1
function Run() { gotoAndPlay (2); }
Symbol 298 MovieClip Frame 7
gotoAndPlay (2);
Symbol 302 MovieClip Frame 1
function Run() { gotoAndPlay (2); }
Symbol 302 MovieClip Frame 7
gotoAndPlay (2);
Symbol 306 MovieClip Frame 1
function Run() { gotoAndPlay (2); }
Symbol 306 MovieClip Frame 7
gotoAndPlay (2);
Symbol 311 MovieClip Frame 1
function Run() { gotoAndPlay (2); }
Symbol 311 MovieClip Frame 7
gotoAndPlay (2);
Symbol 312 MovieClip Frame 1
kicker.stop();
Symbol 312 MovieClip Frame 2
kicker.stop();
Symbol 312 MovieClip Frame 3
kicker.stop();
Symbol 312 MovieClip Frame 4
kicker.stop();
Symbol 312 MovieClip Frame 5
kicker.stop();

Library Items

Symbol 1 Sound [whistle]
Symbol 2 Sound [kick]
Symbol 3 Sound [miss]
Symbol 4 Sound [croud]
Symbol 5 Sound [cheer]
Symbol 6 Sound [ballbounce]
Symbol 7 Sound [bounce]Used by:13
Symbol 8 ShapeTweeningUsed by:13
Symbol 9 GraphicUsed by:13
Symbol 10 ShapeTweeningUsed by:13
Symbol 11 ShapeTweeningUsed by:13
Symbol 12 GraphicUsed by:13
Symbol 13 MovieClipUses:8 9 10 7 11 12Used by:48  Timeline
Symbol 14 GraphicUsed by:15
Symbol 15 MovieClipUses:14Used by:Timeline
Symbol 16 GraphicUsed by:26
Symbol 17 GraphicUsed by:26 65
Symbol 18 GraphicUsed by:26 65
Symbol 19 GraphicUsed by:26 65
Symbol 20 GraphicUsed by:26 65
Symbol 21 GraphicUsed by:26 65
Symbol 22 GraphicUsed by:26 65
Symbol 23 GraphicUsed by:26 65
Symbol 24 GraphicUsed by:25
Symbol 25 MovieClipUses:24Used by:26
Symbol 26 MovieClipUses:16 17 18 19 20 21 22 23 25Used by:100  Timeline
Symbol 27 BitmapUsed by:28
Symbol 28 GraphicUses:27Used by:30
Symbol 29 GraphicUsed by:30
Symbol 30 ButtonUses:28 29Used by:Timeline
Symbol 31 FontUsed by:32 33 34 244 247 248 249 250 251 252 253 254 274 275 276 279 280 281 285 286 287 336 337 338 339 342 343 344 352 353
Symbol 32 TextUses:31Used by:Timeline
Symbol 33 EditableTextUses:31Used by:Timeline
Symbol 361 MovieClip [__Packages.com.gskinner.sprites.CollisionDetection]
Symbol 34 EditableTextUses:31Used by:Timeline
Symbol 35 BitmapUsed by:36 94
Symbol 36 GraphicUses:35Used by:48 83
Symbol 37 GraphicUsed by:38 317
Symbol 38 MovieClipUses:37Used by:48 83
Symbol 39 GraphicUsed by:40 318
Symbol 40 MovieClipUses:39Used by:48 83
Symbol 41 GraphicUsed by:48
Symbol 42 GraphicUsed by:48
Symbol 43 FontUsed by:44 84 326 329 347 354
Symbol 44 TextUses:43Used by:48
Symbol 45 GraphicUsed by:48
Symbol 46 FontUsed by:47
Symbol 47 TextUses:46Used by:48
Symbol 48 MovieClipUses:36 38 40 41 13 42 44 45 47Used by:Timeline
Symbol 49 GraphicUsed by:53 55
Symbol 50 GraphicUsed by:53 55
Symbol 51 GraphicUsed by:52 55 59
Symbol 52 MovieClipUses:51Used by:53 58
Symbol 53 MovieClipUses:49 50 52Used by:55
Symbol 54 GraphicUsed by:55 59
Symbol 55 ButtonUses:53 54 49 50 51Used by:Timeline
Symbol 56 GraphicUsed by:58 59
Symbol 57 GraphicUsed by:58 59
Symbol 58 MovieClipUses:56 57 52Used by:59
Symbol 59 ButtonUses:58 54 56 57 51Used by:Timeline
Symbol 60 GraphicUsed by:61
Symbol 61 MovieClipUses:60Used by:65
Symbol 62 GraphicUsed by:63
Symbol 63 MovieClipUses:62Used by:65
Symbol 64 GraphicUsed by:65
Symbol 65 MovieClipUses:61 17 18 19 20 21 22 23 63 64Used by:Timeline
Symbol 66 MovieClipUsed by:Timeline
Symbol 67 GraphicUsed by:68
Symbol 68 ButtonUses:67Used by:69
Symbol 69 MovieClipUses:68Used by:Timeline
Symbol 70 GraphicUsed by:71
Symbol 71 ButtonUses:70Used by:72
Symbol 72 MovieClipUses:71Used by:Timeline
Symbol 73 GraphicUsed by:Timeline
Symbol 74 GraphicUsed by:83
Symbol 75 FontUsed by:76
Symbol 76 TextUses:75Used by:83
Symbol 77 GraphicUsed by:83
Symbol 78 FontUsed by:79 80 81 82
Symbol 79 TextUses:78Used by:83
Symbol 80 TextUses:78Used by:83
Symbol 81 TextUses:78Used by:83
Symbol 82 TextUses:78Used by:83
Symbol 83 MovieClipUses:36 38 40 74 76 77 79 80 81 82Used by:Timeline
Symbol 84 TextUses:43Used by:88
Symbol 85 GraphicUsed by:88
Symbol 86 GraphicUsed by:88
Symbol 87 GraphicUsed by:88
Symbol 88 ButtonUses:84 85 86 87Used by:Timeline
Symbol 89 GraphicUsed by:92
Symbol 90 GraphicUsed by:92
Symbol 91 GraphicUsed by:92
Symbol 92 ButtonUses:89 90 91Used by:Timeline
Symbol 93 GraphicUsed by:100
Symbol 94 GraphicUses:35Used by:95
Symbol 95 MovieClipUses:94Used by:100
Symbol 96 GraphicUsed by:100
Symbol 97 GraphicUsed by:98
Symbol 98 MovieClipUses:97Used by:100
Symbol 99 GraphicUsed by:100
Symbol 100 MovieClipUses:93 95 96 26 98 99Used by:Timeline
Symbol 101 GraphicUsed by:102
Symbol 102 MovieClipUses:101Used by:Timeline
Symbol 103 GraphicUsed by:109
Symbol 104 GraphicUsed by:109
Symbol 105 GraphicUsed by:109
Symbol 106 GraphicUsed by:109
Symbol 107 GraphicUsed by:109
Symbol 108 GraphicUsed by:109
Symbol 109 MovieClipUses:103 104 105 106 107 108Used by:Timeline
Symbol 110 GraphicUsed by:111
Symbol 111 MovieClipUses:110Used by:Timeline
Symbol 112 GraphicUsed by:113
Symbol 113 MovieClipUses:112Used by:Timeline
Symbol 114 GraphicUsed by:Timeline
Symbol 115 GraphicUsed by:116
Symbol 116 MovieClipUses:115Used by:Timeline
Symbol 117 GraphicUsed by:136
Symbol 118 GraphicUsed by:136
Symbol 119 GraphicUsed by:136
Symbol 120 GraphicUsed by:136
Symbol 121 GraphicUsed by:136
Symbol 122 GraphicUsed by:136 231
Symbol 123 GraphicUsed by:136
Symbol 124 GraphicUsed by:136
Symbol 125 GraphicUsed by:136
Symbol 126 GraphicUsed by:136
Symbol 127 GraphicUsed by:136
Symbol 128 GraphicUsed by:136
Symbol 129 GraphicUsed by:136
Symbol 130 GraphicUsed by:136
Symbol 131 GraphicUsed by:136
Symbol 132 GraphicUsed by:136
Symbol 133 GraphicUsed by:136
Symbol 134 GraphicUsed by:136
Symbol 135 GraphicUsed by:136
Symbol 136 MovieClipUses:117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135Used by:Timeline
Symbol 137 GraphicUsed by:231
Symbol 138 GraphicUsed by:231
Symbol 139 GraphicUsed by:231
Symbol 140 ShapeTweeningUsed by:231
Symbol 141 GraphicUsed by:231
Symbol 142 GraphicUsed by:231
Symbol 143 GraphicUsed by:231
Symbol 144 GraphicUsed by:231
Symbol 145 GraphicUsed by:231
Symbol 146 GraphicUsed by:231
Symbol 147 GraphicUsed by:231
Symbol 148 GraphicUsed by:231
Symbol 149 ShapeTweeningUsed by:231
Symbol 150 GraphicUsed by:231
Symbol 151 GraphicUsed by:231
Symbol 152 GraphicUsed by:231
Symbol 153 GraphicUsed by:231
Symbol 154 GraphicUsed by:231
Symbol 155 GraphicUsed by:231
Symbol 156 GraphicUsed by:231
Symbol 157 GraphicUsed by:231
Symbol 158 ShapeTweeningUsed by:231
Symbol 159 GraphicUsed by:231
Symbol 160 ShapeTweeningUsed by:231
Symbol 161 GraphicUsed by:231
Symbol 162 GraphicUsed by:231
Symbol 163 GraphicUsed by:231
Symbol 164 GraphicUsed by:231
Symbol 165 GraphicUsed by:231
Symbol 166 GraphicUsed by:231
Symbol 167 GraphicUsed by:231
Symbol 168 ShapeTweeningUsed by:231
Symbol 169 GraphicUsed by:231
Symbol 170 GraphicUsed by:231
Symbol 171 GraphicUsed by:231
Symbol 172 GraphicUsed by:231
Symbol 173 GraphicUsed by:231
Symbol 174 GraphicUsed by:231
Symbol 175 GraphicUsed by:231
Symbol 176 GraphicUsed by:231
Symbol 177 ShapeTweeningUsed by:231
Symbol 178 ShapeTweeningUsed by:231
Symbol 179 GraphicUsed by:231
Symbol 180 GraphicUsed by:231
Symbol 181 GraphicUsed by:231
Symbol 182 GraphicUsed by:231
Symbol 183 GraphicUsed by:231
Symbol 184 GraphicUsed by:231
Symbol 185 GraphicUsed by:231
Symbol 186 ShapeTweeningUsed by:231
Symbol 187 GraphicUsed by:231
Symbol 188 GraphicUsed by:231
Symbol 189 GraphicUsed by:231
Symbol 190 GraphicUsed by:231
Symbol 191 GraphicUsed by:231
Symbol 192 GraphicUsed by:231
Symbol 193 GraphicUsed by:231
Symbol 194 ShapeTweeningUsed by:231
Symbol 195 ShapeTweeningUsed by:231
Symbol 196 GraphicUsed by:231
Symbol 197 GraphicUsed by:231
Symbol 198 GraphicUsed by:231
Symbol 199 GraphicUsed by:231
Symbol 200 GraphicUsed by:231
Symbol 201 GraphicUsed by:231
Symbol 202 GraphicUsed by:231
Symbol 203 ShapeTweeningUsed by:231
Symbol 204 GraphicUsed by:231
Symbol 205 GraphicUsed by:231
Symbol 206 GraphicUsed by:231
Symbol 207 GraphicUsed by:231
Symbol 208 GraphicUsed by:231
Symbol 209 GraphicUsed by:231
Symbol 210 ShapeTweeningUsed by:231
Symbol 211 GraphicUsed by:231
Symbol 212 GraphicUsed by:231
Symbol 213 GraphicUsed by:231
Symbol 214 GraphicUsed by:231
Symbol 215 GraphicUsed by:231
Symbol 216 GraphicUsed by:231
Symbol 217 GraphicUsed by:231
Symbol 218 ShapeTweeningUsed by:231
Symbol 219 GraphicUsed by:231
Symbol 220 ShapeTweeningUsed by:231
Symbol 221 GraphicUsed by:231
Symbol 222 ShapeTweeningUsed by:231
Symbol 223 GraphicUsed by:231
Symbol 224 ShapeTweeningUsed by:231
Symbol 225 GraphicUsed by:231
Symbol 226 ShapeTweeningUsed by:231
Symbol 227 GraphicUsed by:231
Symbol 228 ShapeTweeningUsed by:231
Symbol 229 GraphicUsed by:231
Symbol 230 GraphicUsed by:231
Symbol 231 MovieClipUses:122 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230Used by:Timeline
Symbol 232 GraphicUsed by:233
Symbol 233 MovieClipUses:232Used by:Timeline
Symbol 234 GraphicUsed by:235 277 282 288
Symbol 235 MovieClipUses:234Used by:277 282 288  Timeline
Symbol 236 GraphicUsed by:237
Symbol 237 MovieClipUses:236Used by:238
Symbol 238 MovieClipUses:237Used by:Timeline
Symbol 239 FontUsed by:240 241
Symbol 240 TextUses:239Used by:242
Symbol 241 TextUses:239Used by:242
Symbol 242 MovieClipUses:240 241Used by:Timeline
Symbol 243 GraphicUsed by:245
Symbol 244 EditableTextUses:31Used by:245
Symbol 245 MovieClipUses:243 244Used by:246
Symbol 246 MovieClipUses:245Used by:Timeline
Symbol 247 TextUses:31Used by:Timeline
Symbol 248 TextUses:31Used by:Timeline
Symbol 249 TextUses:31Used by:Timeline
Symbol 250 TextUses:31Used by:Timeline
Symbol 251 EditableTextUses:31Used by:Timeline
Symbol 252 EditableTextUses:31Used by:Timeline
Symbol 253 EditableTextUses:31Used by:Timeline
Symbol 254 EditableTextUses:31Used by:Timeline
Symbol 255 GraphicUsed by:256
Symbol 256 MovieClipUses:255Used by:Timeline
Symbol 257 GraphicUsed by:258
Symbol 258 MovieClipUses:257Used by:Timeline
Symbol 259 GraphicUsed by:273
Symbol 260 FontUsed by:261 262 263 264 265 266 267 268 269 270 271 272
Symbol 261 TextUses:260Used by:273
Symbol 262 EditableTextUses:260Used by:273
Symbol 263 EditableTextUses:260Used by:273
Symbol 264 EditableTextUses:260Used by:273
Symbol 265 EditableTextUses:260Used by:273
Symbol 266 EditableTextUses:260Used by:273
Symbol 267 EditableTextUses:260Used by:273
Symbol 268 EditableTextUses:260Used by:273
Symbol 269 EditableTextUses:260Used by:273
Symbol 270 EditableTextUses:260Used by:273
Symbol 271 EditableTextUses:260Used by:273
Symbol 272 TextUses:260Used by:273
Symbol 273 MovieClipUses:259 261 262 263 264 265 266 267 268 269 270 271 272Used by:Timeline
Symbol 274 TextUses:31Used by:277
Symbol 275 TextUses:31Used by:277
Symbol 276 TextUses:31Used by:277
Symbol 277 ButtonUses:274 235 275 276 234Used by:283
Symbol 278 GraphicUsed by:282 288
Symbol 279 TextUses:31Used by:282
Symbol 280 TextUses:31Used by:282
Symbol 281 TextUses:31Used by:282
Symbol 282 ButtonUses:278 279 235 280 281 234Used by:283  Timeline
Symbol 283 MovieClipUses:277 282Used by:284
Symbol 284 MovieClipUses:283Used by:Timeline
Symbol 285 TextUses:31Used by:288
Symbol 286 TextUses:31Used by:288
Symbol 287 TextUses:31Used by:288
Symbol 288 ButtonUses:278 285 235 286 287 234Used by:Timeline
Symbol 289 GraphicUsed by:294
Symbol 290 GraphicUsed by:294
Symbol 291 GraphicUsed by:294
Symbol 292 GraphicUsed by:294
Symbol 293 GraphicUsed by:294
Symbol 294 MovieClipUses:289 290 291 292 293Used by:312
Symbol 295 GraphicUsed by:298
Symbol 296 GraphicUsed by:298
Symbol 297 GraphicUsed by:298
Symbol 298 MovieClipUses:295 296 297Used by:312
Symbol 299 GraphicUsed by:302
Symbol 300 GraphicUsed by:302
Symbol 301 GraphicUsed by:302
Symbol 302 MovieClipUses:299 300 301Used by:312
Symbol 303 GraphicUsed by:306
Symbol 304 GraphicUsed by:306
Symbol 305 GraphicUsed by:306
Symbol 306 MovieClipUses:303 304 305Used by:312
Symbol 307 GraphicUsed by:311
Symbol 308 GraphicUsed by:311
Symbol 309 GraphicUsed by:311
Symbol 310 GraphicUsed by:311
Symbol 311 MovieClipUses:307 308 309 310Used by:312
Symbol 312 MovieClipUses:294 298 302 306 311Used by:Timeline
Symbol 313 GraphicUsed by:314
Symbol 314 MovieClipUses:313Used by:Timeline
Symbol 315 BitmapUsed by:316
Symbol 316 GraphicUses:315Used by:328 351
Symbol 317 MovieClipUses:37Used by:328 351
Symbol 318 MovieClipUses:39Used by:328 351
Symbol 319 GraphicUsed by:328 351
Symbol 320 GraphicUsed by:321
Symbol 321 MovieClipUses:320Used by:328 351
Symbol 322 GraphicUsed by:328
Symbol 323 GraphicUsed by:324
Symbol 324 MovieClipUses:323Used by:328 351
Symbol 325 GraphicUsed by:328
Symbol 326 TextUses:43Used by:328
Symbol 327 GraphicUsed by:328
Symbol 328 MovieClipUses:316 317 318 319 321 322 324 325 326 327Used by:Timeline
Symbol 329 TextUses:43Used by:333
Symbol 330 GraphicUsed by:333
Symbol 331 GraphicUsed by:333
Symbol 332 GraphicUsed by:333
Symbol 333 ButtonUses:329 330 331 332Used by:335
Symbol 334 GraphicUsed by:335
Symbol 335 MovieClipUses:333 334Used by:Timeline
Symbol 336 TextUses:31Used by:Timeline
Symbol 337 EditableTextUses:31Used by:Timeline
Symbol 338 TextUses:31Used by:Timeline
Symbol 339 EditableTextUses:31Used by:Timeline
Symbol 340 GraphicUsed by:341
Symbol 341 MovieClipUses:340Used by:Timeline
Symbol 342 EditableTextUses:31Used by:Timeline
Symbol 343 TextUses:31Used by:Timeline
Symbol 344 EditableTextUses:31Used by:Timeline
Symbol 345 GraphicUsed by:351
Symbol 346 GraphicUsed by:351
Symbol 347 TextUses:43Used by:351
Symbol 348 GraphicUsed by:349
Symbol 349 MovieClipUses:348Used by:351
Symbol 350 GraphicUsed by:351
Symbol 351 MovieClipUses:316 317 318 319 321 345 324 346 347 349 350Used by:Timeline
Symbol 352 TextUses:31Used by:Timeline
Symbol 353 EditableTextUses:31Used by:Timeline
Symbol 354 TextUses:43Used by:358
Symbol 355 GraphicUsed by:358
Symbol 356 GraphicUsed by:358
Symbol 357 GraphicUsed by:358
Symbol 358 ButtonUses:354 355 356 357Used by:360
Symbol 359 GraphicUsed by:360
Symbol 360 MovieClipUses:358 359Used by:Timeline

Instance Names

"txtLoadPercentage"Frame 1Symbol 33 EditableText
"txtLoadPercentage"Frame 100Symbol 34 EditableText
"btnPlay"Frame 101Symbol 55 Button
"btnInstructions"Frame 101Symbol 59 Button
"soundmovieclip"Frame 101Symbol 66 MovieClip
"soundmovieclip2"Frame 101Symbol 66 MovieClip
"unmutebutton"Frame 101Symbol 69 MovieClip
"mutebutton"Frame 101Symbol 72 MovieClip
"btnPlayButton"Frame 102Symbol 88 Button
"goalPost"Frame 103Symbol 109 MovieClip
"goalArea"Frame 103Symbol 113 MovieClip
"kickArea"Frame 103Symbol 116 MovieClip
"obstacle0"Frame 103Symbol 136 MovieClip
"obstacle1"Frame 103Symbol 136 MovieClip
"obstacle2"Frame 103Symbol 136 MovieClip
"goalKeeper"Frame 103Symbol 231 MovieClip
"ballShadow"Frame 103Symbol 233 MovieClip
"ball"Frame 103Symbol 235 MovieClip
"mcWindDirection"Frame 103Symbol 238 MovieClip
"flashAlerts"Frame 103Symbol 242 MovieClip
"scoreCard"Frame 103Symbol 246 MovieClip
"txtScore"Frame 103Symbol 251 EditableText
"txtChancesLeft"Frame 103Symbol 252 EditableText
"txtLevel"Frame 103Symbol 253 EditableText
"txtWindSpeed"Frame 103Symbol 254 EditableText
"mcArrow"Frame 103Symbol 256 MovieClip
"extremeborder"Frame 103Symbol 258 MovieClip
"toolBar"Frame 103Symbol 284 MovieClip
"btnReplay"Frame 103Symbol 288 Button
"btnNextLevel"Frame 103Symbol 282 Button
"mcKicker"Frame 103Symbol 312 MovieClip
"ballMover"Frame 103Symbol 314 MovieClip
"targetMarker"Frame 103Symbol 314 MovieClip
"obstacle3"Frame 104Symbol 136 MovieClip
"obstacle4"Frame 107Symbol 136 MovieClip
"obstacle4"Frame 109Symbol 136 MovieClip
"obstacle5"Frame 110Symbol 136 MovieClip
"btnTry"Frame 113Symbol 328 MovieClip
"btnPlayAgain"Frame 113Symbol 335 MovieClip
"txtFinalScore"Frame 113Symbol 337 EditableText
"txtChancesLeft"Frame 113Symbol 339 EditableText
"txtTotalBonus"Frame 113Symbol 342 EditableText
"txtGrandTotal"Frame 113Symbol 344 EditableText
"btnTry"Frame 114Symbol 351 MovieClip
"txtFinalScore"Frame 114Symbol 353 EditableText
"btnTryAgain"Frame 114Symbol 360 MovieClip
"button"Symbol 69 MovieClip Frame 1Symbol 68 Button
"button"Symbol 72 MovieClip Frame 1Symbol 71 Button
"txtScore"Symbol 245 MovieClip Frame 1Symbol 244 EditableText
"scoreDisplay"Symbol 246 MovieClip Frame 1Symbol 245 MovieClip
"btnRetry"Symbol 283 MovieClip Frame 1Symbol 277 Button
"btnNextLevel"Symbol 283 MovieClip Frame 1Symbol 282 Button
"toolbarButtons"Symbol 284 MovieClip Frame 1Symbol 283 MovieClip
"kicker"Symbol 312 MovieClip Frame 1Symbol 294 MovieClip
"kicker"Symbol 312 MovieClip Frame 2Symbol 298 MovieClip
"kicker"Symbol 312 MovieClip Frame 3Symbol 302 MovieClip
"kicker"Symbol 312 MovieClip Frame 4Symbol 306 MovieClip
"kicker"Symbol 312 MovieClip Frame 5Symbol 311 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.
ExportAssets (56)Timeline Frame 1Symbol 1 as "whistle"
ExportAssets (56)Timeline Frame 1Symbol 2 as "kick"
ExportAssets (56)Timeline Frame 1Symbol 3 as "miss"
ExportAssets (56)Timeline Frame 1Symbol 4 as "croud"
ExportAssets (56)Timeline Frame 1Symbol 5 as "cheer"
ExportAssets (56)Timeline Frame 1Symbol 6 as "ballbounce"
ExportAssets (56)Timeline Frame 1Symbol 7 as "bounce"
ExportAssets (56)Timeline Frame 1Symbol 361 as "__Packages.com.gskinner.sprites.CollisionDetection"

Labels

"instructions"Frame 102
"gameover"Frame 114
"walk"Symbol 231 MovieClip Frame 2
"jumpright"Symbol 231 MovieClip Frame 11
"jumpleft"Symbol 231 MovieClip Frame 51
"smalljumpright"Symbol 231 MovieClip Frame 87
"smalljumpleft"Symbol 231 MovieClip Frame 104
"defend"Symbol 231 MovieClip Frame 118
"jumpdefend"Symbol 231 MovieClip Frame 135
"goal"Symbol 242 MovieClip Frame 1
"save"Symbol 242 MovieClip Frame 21

Dynamic Text Variables

_root.totalScoreSymbol 251 EditableText"1"
_root.numChancesSymbol 252 EditableText"10"
_root.levelScore1Symbol 262 EditableText"0"
_root.levelScore2Symbol 263 EditableText"0"
_root.levelScore3Symbol 264 EditableText"0"
_root.levelScore4Symbol 265 EditableText"0"
_root.levelScore5Symbol 266 EditableText"0"
_root.levelScore6Symbol 267 EditableText"0"
_root.levelScore7Symbol 268 EditableText"0"
_root.levelScore8Symbol 269 EditableText"0"
_root.levelScore9Symbol 270 EditableText"0"
_root.levelScore10Symbol 271 EditableText"0"




http://swfchan.com/47/231131/info.shtml
Created: 19/1 -2020 20:59:49 Last modified: 19/1 -2020 20:59:49 Server time: 01/05 -2024 02:23:23