Frame 1
if (this.inited == undefined) {
this.inited = true;
com.novelgames.flashgames.MainBirdizDemo.initialize(this);
this.getEnterPosition = function (from_str) {
return({x:this.decor.playerPlace._x, y:this.decor.playerPlace._y, cam:this.decor.cam_chamdedal});
};
this.onSpecialCollision = function (instance, chimbo) {
};
this.onSpecialCollisionOut = function (instance, chimbo) {
};
this.onCustomMessage = function (type, _xml) {
this.kashgame.onCustomMessage(type, _xml);
};
this.cleanBeforeUnload = function () {
};
this.prepareToStart = function (chimbo_mc) {
};
collclip._xscale = (collclip._yscale = 100);
collclip._x = (collclip._y = 0);
collclip._visible = false;
speCollClip._xscale = (speCollClip._yscale = 100);
speCollClip._x = (speCollClip._y = 0);
speCollClip._visible = false;
decor._xscale = (decor._yscale = 100);
decor._x = (decor._y = 0);
decor.template_character._visible = false;
_level0.chimberg_name = _level0.localString("mountain.bac_expert");
}
stop();
Symbol 47 MovieClip [messageResult] Frame 1
#initclip 59
Object.registerClass("messageResult", com.novelgames.flashgames.minigolfAS2.MessageResult);
#endinitclip
Symbol 69 MovieClip [defaultButton] Frame 1
#initclip 40
Object.registerClass("defaultButton", chapatiz.display.MCButton);
#endinitclip
Symbol 76 MovieClip [Jauge] Frame 1
#initclip 41
Object.registerClass("Jauge", com.novelgames.flashgames.minigolfAS2.Jauge);
#endinitclip
Symbol 81 MovieClip Frame 1
stop();
onEnterFrame = function () {
a = Math.random();
if (a > 0.9) {
play();
}
};
Symbol 83 MovieClip Frame 1
t.text = _level0.langArray.CLACBRIK_START;
Symbol 91 MovieClip Frame 1
t.text = _level0.langArray.CLACBRIK_SCORE;
Symbol 94 MovieClip Frame 1
t.text = _level0.langArray.CLACBRIK_MOREGAMES;
Symbol 97 MovieClip [Title] Frame 1
#initclip 42
Object.registerClass("Title", com.novelgames.flashgames.minigolfAS2.Title);
#endinitclip
stop();
Symbol 108 MovieClip Frame 9
stop();
Symbol 109 MovieClip Frame 15
stop();
Symbol 111 MovieClip [mcbt_infos] Frame 1
#initclip 43
Object.registerClass("mcbt_infos", chapatiz.display.MCButton);
#endinitclip
stop();
Symbol 117 MovieClip Frame 15
stop();
Symbol 119 MovieClip [mcbt_scores] Frame 1
#initclip 44
Object.registerClass("mcbt_scores", chapatiz.display.MCButton);
#endinitclip
stop();
Symbol 125 MovieClip Frame 15
stop();
Symbol 127 MovieClip [mc_bt_jouer] Frame 1
#initclip 45
Object.registerClass("mc_bt_jouer", chapatiz.display.MCButton);
#endinitclip
stop();
Symbol 136 MovieClip Frame 1
poulet = "un poulet 1";
playAnime = function () {
play();
};
stop();
Symbol 136 MovieClip Frame 2
poulet = "un poulet 1";
Symbol 136 MovieClip Frame 3
stop();
Symbol 173 MovieClip [Block] Frame 1
#initclip 46
Object.registerClass("Block", com.novelgames.flashgames.minigolfAS2.Block);
#endinitclip
poulet = "pipi";
Symbol 173 MovieClip [Block] Frame 12
poulet = lepoulet;
trace((("game:" + lepoulet) + ",") + _root._game);
_root._game.setPoulet(lepoulet, (_parent._x + lepoulet._x) + _x, (_parent._y + lepoulet._y) + _y);
Symbol 175 MovieClip [InstructionsButton] Frame 1
#initclip 47
Object.registerClass("InstructionsButton", com.novelgames.flashgames.commonAS2.InstructionsButton);
#endinitclip
Symbol 181 MovieClip [MuteButton] Frame 1
#initclip 48
Object.registerClass("MuteButton", com.novelgames.flashgames.commonAS2.MuteButton);
#endinitclip
Symbol 184 MovieClip [empty] Frame 1
#initclip 49
Object.registerClass("empty", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 219 MovieClip [Ball] Frame 1
#initclip 50
Object.registerClass("Ball", com.novelgames.flashgames.minigolfAS2.Ball);
#endinitclip
Symbol 230 MovieClip [clickDetector] Frame 1
#initclip 51
Object.registerClass("clickDetector", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 231 MovieClip [Message] Frame 1
#initclip 52
Object.registerClass("Message", com.novelgames.flashgames.minigolfAS2.Message);
#endinitclip
Symbol 233 MovieClip [arrowMask] Frame 1
#initclip 53
Object.registerClass("arrowMask", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 235 MovieClip [Arrow] Frame 1
#initclip 54
Object.registerClass("Arrow", com.novelgames.flashgames.minigolfAS2.Arrow);
#endinitclip
Symbol 244 MovieClip [Game] Frame 1
#initclip 55
Object.registerClass("Game", com.novelgames.flashgames.minigolfAS2.Game);
#endinitclip
Symbol 248 MovieClip [Instructions] Frame 1
#initclip 56
Object.registerClass("Instructions", com.novelgames.flashgames.minigolfAS2.Instructions);
#endinitclip
Symbol 251 MovieClip [MessageHole] Frame 1
#initclip 57
Object.registerClass("MessageHole", com.novelgames.flashgames.minigolfAS2.MessageHole);
#endinitclip
Symbol 255 MovieClip [MessagePlayAgain] Frame 1
#initclip 58
Object.registerClass("MessagePlayAgain", com.novelgames.flashgames.minigolfAS2.MessagePlayAgain);
#endinitclip
Symbol 267 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 103
gotoAndStop (1);
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 103
gotoAndStop (1);
Symbol 273 MovieClip [__Packages.com.novelgames.flashgames.MainBirdizDemo] Frame 0
class com.novelgames.flashgames.MainBirdizDemo extends MovieClip
{
var game, attachMovie, titleDepth, title, _width, _height, instructions, getNextHighestDepth, onEnterFrame, stop;
function MainBirdizDemo () {
super();
}
static function initialize(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.MainBirdizDemo.prototype;
com.novelgames.flashgames.minigolfAS2.Config.GAME_DEMO = true;
com.novelgames.flashgames.minigolfAS2.Config.GAME_INCHAPALAND = false;
com.novelgames.flashgames.minigolfAS2.Config.URL_REDIRECT = "http://uk.chapatiz.com";
_level0.langArray = new Array();
_level0.langArray.BIRDIZ_START = "Start";
_level0.langArray.BIRDIZ_SCORE = "Score";
_level0.langArray.BIRDIZ_MOREGAMES = "More games";
_level0.langArray.BIRDIZ_REPLAY = "Play again";
_level0.langArray.BIRDIZ_HOWTOPLAY0 = "Use the mouse to aim and click to shoot";
_level0.langArray.BIRDIZ_SCORE0 = "Score :";
_level0.langArray.BIRDIZ_SCORE1 = "Come to Chapatiz to improve your swing!";
_level0.langArray.BIRDIZ_LAND = "Field";
_level0.langArray.BIRDIZ_SCORELABEL = "Score";
_level0.langArray.BIRDIZ_HOLELABEL = "Hole";
_level0.langArray.BIRDIZ_PARLABEL = "Par";
_level0.langArray.BIRDIZ_SHOTSLABEL = "Shots";
_level0.langArray.BIRDIZ_PARNAME_HOLEINONE = "Hole in one";
_level0.langArray.BIRDIZ_PARNAME_PAR = "Par";
_level0.langArray.BIRDIZ_PARNAME_BIRDIE = "Birdie";
_level0.langArray.BIRDIZ_PARNAME_EAGLE = "Eagle";
_level0.langArray.BIRDIZ_PARNAME_TURKEY = "Turkey";
_level0.langArray.BIRDIZ_PARNAME_OSPREY = "Osprey";
_level0.langArray.BIRDIZ_PARNAME_OSTRICH = "Ostrich";
_level0.langArray.BIRDIZ_PARNAME_BOGEY = "Bogey";
_level0.langArray.BIRDIZ_PARNAME_DOUBLEBOGEY = "Double Bogey";
_level0.langArray.BIRDIZ_PARNAME_BAD = "Bad";
_level0.langArray.BIRDIZ_PARNAME_GOOD = "Good";
movieClip.onEnterFrame = movieClip.checkTitle;
movieClip.stop();
movieClip.gotoTitlePage();
}
static function initializeTilte(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.MainBirdizDemo.prototype;
movieClip.onEnterFrame = movieClip.checkTitle;
movieClip.stop();
movieClip.gotoTileGamePage();
}
function gotoTileGamePage() {
removePage();
game = attachMovie("TilesGame", "tilesGame", titleDepth);
}
function gotoTitlePage() {
removePage();
title = com.novelgames.flashgames.minigolfAS2.Title(attachMovie("Title", "title", titleDepth));
title._x = (_width - title._width) / 2;
title._y = (_height - title._height) / 2;
}
function gotoInstructionsPage() {
removePage();
instructions = com.novelgames.flashgames.minigolfAS2.Instructions(attachMovie("Instructions", "instructions", titleDepth));
instructions.initialize();
}
function gotoGamePage() {
removePage();
game = attachMovie("Game", "game", titleDepth);
}
function showInstructionsFromGame() {
game.pause();
game._visible = false;
instructions = com.novelgames.flashgames.minigolfAS2.Instructions(attachMovie("Instructions", "instructions", getNextHighestDepth()));
instructions.swapDepths(titleDepth);
instructions.initialize(true);
}
function hideInstructionsFromGame() {
instructions.swapDepths(game.getDepth());
instructions.removeMovieClip();
instructions = null;
game._visible = true;
game.unpause();
}
function showHighScores() {
trace("showHighScores()");
}
function showEnterHighScore(score) {
trace(("showEnterHighScore(" + score) + ")");
}
function checkTitle() {
if (!title) {
return(undefined);
}
onEnterFrame = null;
(stop());// not popped
titleDepth = title.getDepth();
}
function removePage() {
if (title) {
title.removeMovieClip();
title = null;
}
if (instructions) {
instructions.removeMovieClip();
instructions = null;
}
if (game) {
game.removeMovieClip();
game = null;
}
}
}
Symbol 274 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Title] Frame 0
class com.novelgames.flashgames.minigolfAS2.Title extends MovieClip
{
var startButton, highScoresButton, moreGamesButton, bt_chapatiz, _parent, getURL;
function Title () {
super();
startButton.__proto__ = chapatiz.display.MCButton.prototype;
highScoresButton.__proto__ = chapatiz.display.MCButton.prototype;
moreGamesButton.__proto__ = chapatiz.display.MCButton.prototype;
startButton.onReleaseMC = function () {
this._parent.startButtonClicked();
};
highScoresButton.onReleaseMC = function () {
this._parent.highScoresButtonClicked();
};
moreGamesButton.onReleaseMC = function () {
this._parent.moreGamesButtonClicked();
};
bt_chapatiz.onRelease = function () {
this._parent.gotoChapatiz();
};
startButton.__set__text(chapatiz.utils.Localisation.localString("BIRDIZ_START"));
highScoresButton.__set__text(chapatiz.utils.Localisation.localString("BIRDIZ_SCORE"));
moreGamesButton.__set__text(chapatiz.utils.Localisation.localString("BIRDIZ_MOREGAMES"));
}
function startButtonClicked() {
_parent.gotoInstructionsPage();
}
function highScoresButtonClicked() {
(getURL(com.novelgames.flashgames.minigolfAS2.Config.URL_REDIRECT + "/games/birdiz/", "_blank"));// not popped
}
function moreGamesButtonClicked() {
(getURL(com.novelgames.flashgames.minigolfAS2.Config.URL_REDIRECT + "/games", "_blank"));// not popped
}
function infoButtonClicked() {
(getURL(com.novelgames.flashgames.minigolfAS2.Config.URL_REDIRECT + "/cms/", "_blank"));// not popped
}
function gotoChapatiz() {
(getURL(com.novelgames.flashgames.minigolfAS2.Config.URL_REDIRECT + "/?from=cgptl", "_blank"));// not popped
}
}
Symbol 275 MovieClip [__Packages.chapatiz.display.MCButton] Frame 0
class chapatiz.display.MCButton extends MovieClip
{
var label, gotoAndStop, onRollOverMC, onRollOutMC, onPressMC, onReleaseMC, onReleaseOutsideMC;
function MCButton () {
super();
_text = label.text;
onRollOut();
}
function set lock(bit) {
_lock = bit;
if (!bit) {
onRollOut();
}
//return(lock);
}
function get lock() {
return(_lock);
}
function set text(str) {
_text = ((str != undefined) ? (str) : "");
label.text = _text;
//return(text);
}
function get text() {
return(_text);
}
function onRollOver() {
if (!_lock) {
gotoAndStop(ROLL_OVER);
label.text = _text;
onRollOverMC();
}
}
function onRollOut() {
if (!_lock) {
gotoAndStop(ROLL_OUT);
label.text = _text;
onRollOutMC();
}
}
function onPress() {
if (!_lock) {
gotoAndStop(PRESS);
label.text = _text;
onPressMC();
}
}
function onRelease() {
if (!_lock) {
gotoAndStop(ROLL_OVER);
label.text = _text;
onReleaseMC();
}
}
function onReleaseOutside() {
if (!_lock) {
gotoAndStop(ROLL_OVER);
label.text = _text;
onReleaseOutsideMC();
}
}
function toString() {
return("MCButton");
}
static var PRESS = "press";
static var ROLL_OVER = "rollOver";
static var ROLL_OUT = "rollOut";
var _lock = false;
var _text = "";
}
Symbol 276 MovieClip [__Packages.chapatiz.utils.Localisation] Frame 0
class chapatiz.utils.Localisation
{
function Localisation () {
}
static function localString(strKey, defaultStr) {
trace((strKey + " ") + _level0.langArray[strKey]);
if (((strKey == undefined) || (_level0.langArray == undefined)) || (_level0.langArray[strKey] == undefined)) {
return(((defaultStr != undefined) ? (defaultStr) : ""));
}
return(_level0.langArray[strKey]);
}
}
Symbol 277 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Config] Frame 0
class com.novelgames.flashgames.minigolfAS2.Config
{
function Config () {
}
static var FIELD_LEFT = 0;
static var FIELD_TOP = 30;
static var FIELD_RIGHT = 650;
static var FIELD_BOTTOM = 450;
static var FIELD_BLOCKSIZEX = 50;
static var FIELD_BLOCKSIZEY = 25;
static var FIELD_INFOS = [[6, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJLJJJJJJJ0\nJJJJJJ444444JJ\nJJJJJJ433324JJ\nJRJJQJ433334JJ\nJJJJJJ433444JJ\nJJJJJJ433334JJ\nJJJMJJ433334JJ\nJJ4444444334JJ\nJJ4333N33334JJ\nJJ4133333334JJ\nJJ433333S334JJ\nJJ4444444444JJ\nJJJJJJJJJJJRJJ\nJJJRJJJJJJJJJJ\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [6, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJ4444444444JJ0\nJJ4355555334JJJ\nJJ4335553334JJJ\nJL4333533N34JJJ\nJJ4334443334MJJ\nJJ4334J43334JJJ\nJJ4334J4T334JJJ\nJJ4334J43334JJJ\nJJ4134J43234JJJ\nJJ4334J43334JJJ\nJJ4444J44444JJJ\nJJQJJJJJJJJLJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [8, "JJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJ0\nJJJJJJJQJJJMJJJ0\nJJJ4444444444JJ0\nJJJ43H5ANA5H4JJ0\nJJL413HAAAH54JJ0\nJJJ43335333H4JJ0\nJJJ4444444334JJ0\nJJJJJ46633334JJ0\nJJJJJ46334444JJ0\nJJJJJ463S324JJJ0\nJJJMJ4333334JJJ0\nJJJJJ4444444JJJ0\nJJQJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJJK\n"], [8, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJQJJJMJJJ0\nJJ444444444JJJ0\nJJ43E666634JJJ0\nJJ433E66D34JJJ0\nJL43P3E6A34JJJ0\nJJ4C3434434JJJ0\nJJ48C433A34JJJ0\nJJ4884233H4JJJ0\nJJ4B843AH54JJJ0\nJJ43B4444444JJ0\nJJ443333S314JJ0\nJJJ433333334JJ0\nJJJ444444444JJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [10, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJQJJJMJJJ0\nJJ444444444JJJ0\nJJ414N66334JJJ0\nJJ434366334JJJ0\nJL43433N434JJJ0\nJJ4C4AA4434LJJ0\nJJ484AA4A54JJJ0\nJJ484A24354JJJ0\nJJ4B4444354JJJ0\nJJ43334AA444JJ0\nJJ444343A634JJ0\nJJJ433333634JJ0\nJJJR44444444JJ0\nJJJJRRRRRRRRJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [12, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJRRRRRRRRMJJJ0\nJJR6666663RJJJ0\nJJR3E66663RJJJ0\nJJR3RRRR33RJJJ0\nJLR35R3333RJJJ0\nJJR33R63RRRJQJ0\nJJRR3R6AA2RJJJ0\nJMR63RRRRRRJJJ0\nJJR33RRJJJJJJJ0\nJJR3RRRRRRRMJJ0\nJJR333TST33LJJ0\nJJRA5535531RLJ0\nJJRRRRRRRRRRJJ0\nJJQJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [3, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJQJJJMJJJ0\nJJ444444444JJJ0\nJJ466666684JJJ0\nJJ476666684JJJ0\nJL477666684JJJ0\nJJ477SSS384JJJ0\nJJ477T3T884JJJ0\nJJ477T2T884JJJ0\nJJ477T3T884JJJ0\nJJ4735338844JJ0\nJJ4775335314JJ0\nJJ4775355334JJ0\nJJ4444444444JJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [10, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJQJJJMJJJ0\nJJ444444444JJJ0\nJJ433333334JJJ0\nJJ4323S3P34JJJ0\nJL43P3333S4JJJ0\nJJ433434334JJJ0\nJJ4S3333T34JJJ0\nJJ4334S3334JJJ0\nJJ4T3333S34JJJ0\nJJ4334434344JJ0\nJJ443S333314JJ0\nJJJ43333S334JJ0\nJJJ444444444JJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"], [6, "JJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJQJJJMJJJ0\nJJ4444444444JJ0\nJJ41884888A4JJ0\nJJ463A3A3A54JJ0\nJL46A4884354JJ0\nJJ4636335A54JJ0\nJJ46A6335354JJ0\nJJ4636335A54JJ0\nJJ46A6335354JJ0\nJJ4634774A44JJ0\nJJ46A3A3A324JJ0\nJJ4A777477A4JJ0\nJJ4444444444JJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJ0\nJJJJJJJJJJJJJJK\n"]];
static var BALL_RADIUS = 8;
static var BALL_MAXSHOOTSPEED = 1000;
static var BALL_MAXARROWLENGTH = 100;
static var BALL_LANDDECELERATION = 500;
static var BALL_HOLEDECELERATION = 5000;
static var BALL_SLOPEACCELERATION = 800;
static var BALL_ATHOLESCALE = 60;
static var BALL_DROPHOLETIME = 100;
static var BALL_NOTMOVETHRESHOLD = 0.02;
static var BALL_NOTMOVETIME = 500;
static var BALL_BOUNCESPEEDRETAIN = 0.7;
static var HOLE_RADIUS = 10;
static var MESSAGE_HOLETIME = 1500;
static var SCORE_PAR = 1000;
static var SCORE_BIRDIE = 2000;
static var SCORE_EAGLE = 3000;
static var SCORE_TURKEY = 4000;
static var SCORE_OSPREY = 5000;
static var SCORE_OSTRICH = 6000;
static var SCORE_GOOD = 7000;
static var GAME_DEMO = false;
static var GAME_INCHAPALAND = false;
static var URL_REDIRECT = "http://www.chapatiz.com";
}
Symbol 278 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Instructions] Frame 0
class com.novelgames.flashgames.minigolfAS2.Instructions extends MovieClip
{
var startButton, t, shownFromGame, didacticiel, _parent;
function Instructions () {
super();
startButton.__proto__ = chapatiz.display.MCButton.prototype;
trace("Instruction");
startButton.onReleaseMC = function () {
this._parent.startButtonClicked();
};
t.text = chapatiz.utils.Localisation.localString("BIRDIZ_HOWTOPLAY0");
startButton.__set__text(chapatiz.utils.Localisation.localString("BIRDIZ_START"));
}
function initialize(shownFromGame) {
if (shownFromGame == undefined) {
shownFromGame = false;
}
this.shownFromGame = shownFromGame;
}
function nextButtonClicked() {
didacticiel.gotoAndStop("page2");
trace("Instruction.nextButtonClicked");
didacticiel.startButton.onRelease = function () {
this._parent._parent.startButtonClicked();
};
}
function startButtonClicked() {
if (!shownFromGame) {
_parent.gotoGamePage();
} else {
_parent.hideInstructionsFromGame();
}
}
}
Symbol 279 MovieClip [__Packages.com.wiicade.Wii] Frame 0
class com.wiicade.Wii
{
static var instance;
var keyboard, lc;
function Wii () {
if (!_global.Wii) {
_global.Wii = this;
} else {
return;
}
wii = System.capabilities.os == "Nintendo Wii";
com.wiicade.WiiRemote.init();
com.wiicade.KeyboardController.init();
com.wiicade.Browser.init();
var _local3 = 0;
while (_local3 < 4) {
remotes[_local3] = new com.wiicade.WiiRemote(_local3);
_local3++;
}
if (!isWii()) {
keyboard = new com.wiicade.KeyboardController(wiicommand);
}
lc = new LocalConnection();
lc.connect("wii");
lc.wiicommand = function (packet) {
_global.Wii.wiicommand(packet);
};
if (isWii()) {
getURL (((("javascript:initializeWiiCadeAPI(20, " + Stage.width) + ", ") + Stage.height) + ");");
}
}
static function getInstance() {
if (!_global.Wii) {
instance = new com.wiicade.Wii();
}
return(_global.Wii);
}
static function init() {
_global.Wii = null;
instance = new com.wiicade.Wii();
}
static function isWii() {
var _local1 = getInstance();
return(_local1.wii || (_local1.virtualized));
}
function wiicommand(packet) {
var _local4 = getInstance();
var _local2 = (4294901760 & packet) >> 16;
var _local3 = packet & 65535;
if (_local2 < 5) {
_local4.remotes[_local2 - 1].buttonsUpdated(_local3);
} else if (_local2 < 9) {
_local4.remotes[_local2 - 5].twistUpdated(_local3);
} else if (_local2 < 13) {
_local4.remotes[_local2 - 9].distanceUpdated(_local3);
} else if (_local2 == 13) {
parseFlags(_local3);
} else if (_local2 < 18) {
parseAttachment(_local3, _local2 - 14);
} else if (_local2 < 22) {
_local4.remotes[_local2 - 18].cursorXUpdated(_local3);
} else if (_local2 < 32) {
_local4.remotes[_local2 - 22].cursorYUpdated(_local3);
}
}
function parseFlags(flags) {
var _local7 = primary;
var _local3;
var _local4;
var _local5 = 8;
primary = flags & 3;
if (primary != _local7) {
getRemote(_local7).updatePrimary(false);
getRemote(primary).updatePrimary(true);
}
virtualized = (4 & _local5) > 0;
var _local2 = 0;
while (_local2 < 4) {
_local3 = getRemote(_local2);
_local4 = (_local5 & flags) > 0;
if (_local3.isConnected() != _local4) {
_local3.connectedUpdated(_local4);
}
_local5 = _local5 << 1;
_local2++;
}
}
function parseAttachment(data, remote) {
var _local4 = getRemote(remote);
var _local3 = _local4.getAttachment();
var _local2;
var _local1;
if ((data & 256) == 0) {
if (!(_local3 instanceof com.wiicade.Nunchuk)) {
_local3 = new com.wiicade.Nunchuk(_local4);
_local4.updateAttachment(_local3);
}
_local3.updateButtons(data & 3);
_local2 = (data & 28) >>> 2;
_local1 = (data & 224) >>> 5;
if ((_local2 & 4) > 0) {
_local2 = _local2 | 65528;
}
if ((_local1 & 4) > 0) {
_local1 = _local1 | 65528;
}
_local2 = Math.floor((_local2 * 128) / 3);
_local1 = Math.floor((_local1 * 128) / 3);
_local3.updateStick(_local2, _local1);
}
}
static function getRemote(identity) {
var _local1 = getInstance();
if ((!_local1.activated[identity]) && (_local1.isWii())) {
getURL (("javascript:activateWiiRemoteFeature(" + identity) + ", null, true);");
_local1.activated[identity] = true;
}
return(_local1.remotes[identity]);
}
static function getPrimaryRemote() {
var _local1 = getInstance();
return(_local1.remotes[_local1.primary]);
}
static var COMMAND_BUTTONS = 1;
static var COMMAND_TWIST = 5;
static var COMMAND_DISTANCE = 9;
static var COMMAND_FLAGS = 13;
static var COMMAND_ATTACH = 14;
static var COMMAND_CURSORX = 18;
static var COMMAND_CURSORY = 22;
var remotes = new Array();
var activated = new Array();
var primary = 0;
var virtualized = false;
var wii = true;
}
Symbol 280 MovieClip [__Packages.com.wiicade.KeyboardController] Frame 0
class com.wiicade.KeyboardController
{
static var keyCodes, buttonCodes;
var callback;
function KeyboardController (callback) {
this.callback = callback;
Key.addListener(this);
Mouse.addListener(this);
if (!keyCodes) {
init();
}
}
static function init() {
keyCodes = new Array();
buttonCodes = new Array();
keyCodes[37] = com.wiicade.WiiRemote.BUTTON_LEFT;
keyCodes[38] = com.wiicade.WiiRemote.BUTTON_UP;
keyCodes[39] = com.wiicade.WiiRemote.BUTTON_RIGHT;
keyCodes[40] = com.wiicade.WiiRemote.BUTTON_DOWN;
keyCodes[65] = com.wiicade.WiiRemote.BUTTON_1;
keyCodes[83] = com.wiicade.WiiRemote.BUTTON_2;
keyCodes[68] = com.wiicade.WiiRemote.BUTTON_A;
keyCodes[32] = com.wiicade.WiiRemote.BUTTON_B;
keyCodes[187] = com.wiicade.WiiRemote.BUTTON_PLUS;
keyCodes[189] = com.wiicade.WiiRemote.BUTTON_MINUS;
buttonCodes[com.wiicade.WiiRemote.BUTTON_LEFT] = 37;
buttonCodes[com.wiicade.WiiRemote.BUTTON_UP] = 38;
buttonCodes[com.wiicade.WiiRemote.BUTTON_RIGHT] = 39;
buttonCodes[com.wiicade.WiiRemote.BUTTON_DOWN] = 40;
buttonCodes[com.wiicade.WiiRemote.BUTTON_1] = 65;
buttonCodes[com.wiicade.WiiRemote.BUTTON_2] = 83;
buttonCodes[com.wiicade.WiiRemote.BUTTON_A] = 68;
buttonCodes[com.wiicade.WiiRemote.BUTTON_B] = 32;
buttonCodes[com.wiicade.WiiRemote.BUTTON_PLUS] = 187;
buttonCodes[com.wiicade.WiiRemote.BUTTON_MINUS] = 189;
}
function onKeyDown() {
var _local2 = Key.getCode();
if (keyCodes[_local2]) {
bitmap = bitmap | keyCodes[_local2];
callback((com.wiicade.Wii.COMMAND_BUTTONS << 16) | bitmap);
}
}
function onKeyUp() {
var _local2 = Key.getCode();
if (keyCodes[_local2]) {
bitmap = bitmap & (~keyCodes[_local2]);
callback((com.wiicade.Wii.COMMAND_BUTTONS << 16) | bitmap);
}
}
function onMouseDown() {
bitmap = bitmap | com.wiicade.WiiRemote.BUTTON_A;
callback((com.wiicade.Wii.COMMAND_BUTTONS << 16) | bitmap);
}
function onMouseUp() {
bitmap = bitmap & (~com.wiicade.WiiRemote.BUTTON_A);
callback((com.wiicade.Wii.COMMAND_BUTTONS << 16) | bitmap);
}
function onMouseMove() {
callback((com.wiicade.Wii.COMMAND_CURSORX << 16) | _xmouse);
callback((com.wiicade.Wii.COMMAND_CURSORY << 16) | _ymouse);
}
static function getButtonMappingForKey(keyCode) {
if (!keyCodes) {
com.wiicade.Wii.isWii();
}
return(keyCodes[keyCode]);
}
static function getKeyMappingForButton(buttonCode) {
if (!keyCodes) {
com.wiicade.Wii.isWii();
}
return(buttonCodes[buttonCode]);
}
static function setKeyMapping(buttonCode, keyCode) {
if (!keyCodes) {
com.wiicade.Wii.isWii();
}
var _local1 = buttonCodes[buttonCode];
var _local2 = keyCodes[keyCode];
if (_local1) {
keyCodes[_local1] = null;
}
if (_local2) {
buttonCodes[_local2] = null;
}
keyCodes[keyCode] = buttonCode;
buttonCodes[buttonCode] = keyCode;
}
var bitmap = 0;
}
Symbol 281 MovieClip [__Packages.com.wiicade.WiiRemote] Frame 0
class com.wiicade.WiiRemote
{
var identity, attachment, activated, dispatchEvent, oldcursorx, oldcursory;
function WiiRemote (identity) {
this.identity = identity;
allowRotate = com.wiicade.Wii.isWii();
attachment = new com.wiicade.Nunchuk(this);
activated = new Array();
if (this.identity == 0) {
primary = true;
connected = true;
}
mx.events.EventDispatcher.initialize(this);
}
static function init() {
}
function getIdentity() {
return(identity);
}
function isPrimary() {
return(primary);
}
function isConnected() {
return(connected);
}
function isRotated() {
return(rotated);
}
function setRotated(rotate) {
rotated = rotate;
}
function getTwistAngle() {
if ((!activated[com.wiicade.Wii.COMMAND_TWIST]) && (com.wiicade.Wii.isWii())) {
getURL (((("javascript:activateWiiRemoteFeature(" + identity) + ", ") + (com.wiicade.Wii.COMMAND_TWIST + identity)) + ", true);");
activated[com.wiicade.Wii.COMMAND_TWIST] = true;
}
return(twistAngle);
}
function getDistance() {
if ((!activated[com.wiicade.Wii.COMMAND_DISTANCE]) && (com.wiicade.Wii.isWii())) {
getURL (((("javascript:activateWiiRemoteFeature(" + identity) + ", ") + (com.wiicade.Wii.COMMAND_DISTANCE + identity)) + ", true);");
activated[com.wiicade.Wii.COMMAND_DISTANCE] = true;
}
return(distance);
}
function getCursorX() {
if ((!activated[com.wiicade.Wii.COMMAND_CURSORX]) && (com.wiicade.Wii.isWii())) {
getURL (((("javascript:activateWiiRemoteFeature(" + identity) + ", ") + (com.wiicade.Wii.COMMAND_CURSORX + identity)) + ", true);");
activated[com.wiicade.Wii.COMMAND_CURSORX] = true;
}
return(cursorx);
}
function getCursorY() {
if ((!activated[com.wiicade.Wii.COMMAND_CURSORX]) && (com.wiicade.Wii.isWii())) {
getURL (((("javascript:activateWiiRemoteFeature(" + identity) + ", ") + (com.wiicade.Wii.COMMAND_CURSORX + identity)) + ", true);");
activated[com.wiicade.Wii.COMMAND_CURSORX] = true;
}
return(cursory);
}
function isFacingScreen() {
return((cursorx > 0) || (cursory > 0));
}
function isDown(buttonCode) {
if (rotated && (allowRotate)) {
if (buttonCode == BUTTON_UP) {
buttonCode = BUTTON_RIGHT;
} else if (buttonCode == BUTTON_RIGHT) {
buttonCode = BUTTON_DOWN;
} else if (buttonCode == BUTTON_DOWN) {
buttonCode = BUTTON_LEFT;
} else if (buttonCode == BUTTON_LEFT) {
buttonCode = BUTTON_UP;
}
}
return((pressed & buttonCode) > 0);
}
function getAttachment() {
if ((!activated[com.wiicade.Wii.COMMAND_ATTACH]) && (com.wiicade.Wii.isWii())) {
getURL (((("javascript:activateWiiRemoteFeature(" + identity) + ", ") + (com.wiicade.Wii.COMMAND_ATTACH + identity)) + ", true);");
activated[com.wiicade.Wii.COMMAND_ATTACH] = true;
}
return(attachment);
}
function buttonsUpdated(bitmap) {
var _local2 = 1;
var _local8 = pressed;
var _local7;
pressed = bitmap;
_local7 = pressed ^ _local8;
var _local3 = 0;
while (_local3 < 10) {
if ((_local7 & _local2) > 0) {
if ((pressed & _local2) > 0) {
dispatchEvent({type:"buttondown", buttonCode:_local2, identity:identity});
} else {
dispatchEvent({type:"buttonup", buttonCode:_local2, identity:identity});
}
}
_local2 = _local2 << 1;
_local3++;
}
}
function twistUpdated(angle) {
var _local2 = twistAngle;
twistAngle = angle;
if (twistAngle != _local2) {
dispatchEvent({type:"twist", angle:angle, identity:identity});
}
}
function distanceUpdated(distance) {
var _local2 = this.distance;
this.distance = distance;
if (this.distance != _local2) {
dispatchEvent({type:"distance", distance:distance, identity:identity});
}
}
function connectedUpdated(connected) {
var _local2 = this.connected;
this.connected = connected;
if (this.connected != _local2) {
if (connected) {
dispatchEvent({type:"connected", identity:identity});
} else {
dispatchEvent({type:"disconnected", identity:identity});
}
}
}
function cursorXUpdated(cursorx) {
oldcursorx = this.cursorx;
this.cursorx = cursorx;
}
function cursorYUpdated(cursory) {
oldcursory = this.cursory;
this.cursory = cursory;
if ((cursorx != oldcursorx) || (this.cursory != oldcursory)) {
dispatchEvent({type:"pointer", cursorx:cursorx, cursory:this.cursory, identity:identity});
}
}
function updatePrimary(primary) {
this.primary = primary;
}
function updateAttachment(attachment) {
this.attachment = attachment;
}
static var BUTTON_UP = 8;
static var BUTTON_DOWN = 4;
static var BUTTON_RIGHT = 2;
static var BUTTON_LEFT = 1;
static var BUTTON_1 = 64;
static var BUTTON_2 = 32;
static var BUTTON_A = 256;
static var BUTTON_B = 128;
static var BUTTON_PLUS = 16;
static var BUTTON_MINUS = 512;
var primary = false;
var connected = false;
var rotated = false;
var allowRotate = true;
var twistAngle = 0;
var distance = 0;
var cursorx = 0;
var cursory = 0;
var pressed = 0;
}
Symbol 282 MovieClip [__Packages.com.wiicade.Nunchuk] Frame 0
class com.wiicade.Nunchuk
{
var parent, dispatchEvent;
function Nunchuk (parent) {
this.parent = parent;
mx.events.EventDispatcher.initialize(this);
}
function isDown(buttonCode) {
return((pressed & buttonCode) > 0);
}
function getStickX() {
return(stickx);
}
function getStickY() {
return(sticky);
}
function updateButtons(buttons) {
var _local2 = 1;
var _local8 = pressed;
var _local7;
pressed = buttons;
_local7 = pressed ^ _local8;
var _local3 = 0;
while (_local3 < 10) {
if ((_local7 & _local2) > 0) {
if ((pressed & _local2) > 0) {
dispatchEvent({type:"buttondown", buttonCode:_local2, identity:parent.getIdentity()});
} else {
dispatchEvent({type:"buttonup", buttonCode:_local2, identity:parent.getIdentity()});
}
}
_local2 = _local2 << 1;
_local3++;
}
}
function updateStick(x, y) {
stickx = x;
sticky = y;
}
static var BUTTON_C = 2;
static var BUTTON_Z = 1;
var pressed = 0;
var stickx = 0;
var sticky = 0;
}
Symbol 283 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 284 MovieClip [__Packages.com.wiicade.Browser] Frame 0
class com.wiicade.Browser
{
static var buttonEnabled;
function Browser () {
}
static function init() {
buttonEnabled = new Array();
buttonEnabled[com.wiicade.WiiRemote.BUTTON_LEFT] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_UP] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_RIGHT] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_DOWN] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_1] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_2] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_A] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_B] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_PLUS] = false;
buttonEnabled[com.wiicade.WiiRemote.BUTTON_MINUS] = false;
}
static function isDefaultEnabled(buttonCode) {
if (!buttonEnabled) {
com.wiicade.Wii.isWii();
}
return(buttonEnabled[buttonCode]);
}
static function setDefaultEnabled(buttonCode, enabled) {
if (!buttonEnabled) {
com.wiicade.Wii.isWii();
}
buttonEnabled[buttonCode] = enabled;
if (com.wiicade.Wii.isWii()) {
getURL (((("javascript:enableWiiButton(" + buttonCode) + ",") + enabled) + ");");
}
}
static function enableZooming() {
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_PLUS, true);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_MINUS, true);
}
static function disableZooming() {
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_PLUS, false);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_MINUS, false);
}
static function enableScrolling() {
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_LEFT, true);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_RIGHT, true);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_UP, true);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_DOWN, true);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_B, true);
}
static function disableScrolling() {
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_LEFT, false);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_RIGHT, false);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_UP, false);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_DOWN, false);
setDefaultEnabled(com.wiicade.WiiRemote.BUTTON_B, false);
}
static function setBackgroundColor(color) {
if (com.wiicade.Wii.isWii()) {
getURL (("javascript:setBackgroundColor(" + color) + ");");
}
}
}
Symbol 285 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewMovieClip] Frame 0
class com.novelgames.flashgames.commonAS2.NewMovieClip extends MovieClip
{
var _parent, _x, _y, _rotation, _visible, _alpha, _width, _height, _xscale, _yscale, _xmouse, _ymouse, _totalframes, _currentframe, _name, __mask, useHandCursor, __mouseEnabled, __mouseChildren, __numChildren, getInstanceAtDepth, getNextHighestDepth, onRelease, onRollOver, onRollOut, onPress, onReleaseOutside, onMouseMove, onEnterFrame, getURL, createMovieCount, attachMovie, createEmptyMovieClip;
function NewMovieClip () {
super();
}
function get parent() {
return(_parent);
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set rotation(rotation) {
_rotation = rotation;
//return(this.rotation);
}
function get rotation() {
return(_rotation);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get width() {
return(_width);
}
function set width(width) {
_width = width;
//return(this.width);
}
function get height() {
return(_height);
}
function set height(height) {
_height = height;
//return(this.height);
}
function set scaleX(scaleX) {
_xscale = scaleX * 100;
//return(this.scaleX);
}
function get scaleX() {
return(_xscale / 100);
}
function set scaleY(scaleY) {
_yscale = scaleY * 100;
//return(this.scaleY);
}
function get scaleY() {
return(_yscale / 100);
}
function set mouseX(mouseX) {
_xmouse = mouseX;
//return(this.mouseX);
}
function get mouseX() {
return(_xmouse);
}
function set mouseY(mouseY) {
_ymouse = mouseY;
//return(this.mouseY);
}
function get mouseY() {
return(_ymouse);
}
function get totalFrames() {
return(_totalframes);
}
function get currentFrame() {
return(_currentframe);
}
function get name() {
return(_name);
}
function set mask(mask) {
__mask = mask;
super.setMask(mask);
//return(this.mask);
}
function get mask() {
return(__mask);
}
function set buttonMode(buttonMode) {
useHandCursor = buttonMode;
//return(this.buttonMode);
}
function get buttonMode() {
return(useHandCursor);
}
function set mouseEnabled(mouseEnabled) {
__mouseEnabled = mouseEnabled;
//return(this.mouseEnabled);
}
function get mouseEnabled() {
return(__mouseEnabled);
}
function set mouseChildren(mouseChildren) {
__mouseChildren = mouseChildren;
//return(this.mouseChildren);
}
function get mouseChildren() {
return(__mouseChildren);
}
function get stage() {
return(com.novelgames.flashgames.commonAS2.NewStage.getNewStage());
}
function set numChildren(numChildren) {
__numChildren = numChildren;
//return(this.numChildren);
}
function get numChildren() {
if (__numChildren == undefined) {
__numChildren = 0;
}
return(__numChildren);
}
function get graphics() {
return(this);
}
function startDrag(lockCenter, bounds) {
if (lockCenter == undefined) {
super.startDrag();
} else if (bounds == undefined) {
super.startDrag(lockCenter);
} else {
super.startDrag(lockCenter, bounds.__get__left(), bounds.__get__top(), bounds.__get__right(), bounds.__get__bottom());
}
}
function beginFill(colour, alpha) {
if (alpha == undefined) {
alpha = 1;
}
super.beginFill(colour, alpha * 100);
}
function getBounds(target) {
var _local2 = super.getBounds(target);
return(new com.novelgames.flashgames.commonAS2.Rectangle(_local2.xMin, _local2.yMin, _local2.xMax - _local2.xMin, _local2.yMax - _local2.yMin));
}
function localToGlobal(point) {
var _local2 = {x:point.x, y:point.y};
super.localToGlobal(_local2);
return(_local2);
}
function globalToLocal(point) {
var _local2 = {x:point.x, y:point.y};
super.globalToLocal(_local2);
return(_local2);
}
function hitTestPoint(x, y, shapeFlag) {
if (shapeFlag == undefined) {
return(super.hitTest(x, y));
}
return(super.hitTest(x, y, shapeFlag));
}
function hitTestObject(obj) {
return(super.hitTest(obj));
}
function addChild(movieClip) {
if (movieClip.addedToParent) {
return(undefined);
}
if (movieClip._parent != this) {
trace("wrong addChild: " + [this, movieClip]);
}
addChildAt(movieClip, numChildren);
}
function addChildAt(movieClip, index) {
if (movieClip.addedToParent) {
return(undefined);
}
if (movieClip._parent != this) {
trace("wrong addChildAt: " + [this, movieClip]);
}
movieClip.addedToParent = true;
numChildren = ((numChildren+1));
setChildIndex(movieClip, index);
}
function removeChild(movieClip) {
if (!movieClip.addedToParent) {
return(undefined);
}
removeChildAt(movieClip.getDepth());
}
function removeChildAt(index) {
var _local5 = getInstanceAtDepth(index);
var _local3;
var _local2;
if (!_local5.addedToParent) {
return(undefined);
}
_local5.removeMovieClip();
_local3 = getNextHighestDepth();
_local2 = index + 1;
while (_local2 < _local3) {
getInstanceAtDepth(_local2).swapDepths(_local2 - 1);
_local2++;
}
numChildren = ((numChildren-1));
}
function setChildIndex(child, index) {
var _local3 = child.getDepth();
var _local2;
var _local1;
if (_local3 == index) {
return(undefined);
}
_local2 = ((_local3 < index) ? 1 : -1);
_local1 = _local3;
while (_local1 != index) {
child.swapDepths(_local1 + _local2);
_local1 = _local1 + _local2;
}
}
function getChildIndex(child) {
return(child.getDepth());
}
function addEventListener(type, listenerObject, listenerFunctionName) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
onReleaseOutside = onRelease;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE :
onMouseMove = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME :
onEnterFrame = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = null;
onReleaseOutside = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE :
onMouseMove = null;
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME :
onEnterFrame = null;
}
}
function navigateToURL(urlRequest, window) {
getURL(urlRequest.url, window);
}
function createMovie(name) {
var _local4 = getNextHighestDepth();
var _local2;
if (createMovieCount == undefined) {
createMovieCount = 0;
}
if (name) {
_local2 = attachMovie(name, (name + "_") + createMovieCount, _local4);
} else {
_local2 = createEmptyMovieClip((name + "_") + createMovieCount, _local4);
_local2.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
_local2.addedToParent = false;
createMovieCount++;
return(_local2);
}
function createSound(name) {
return(new com.novelgames.flashgames.commonAS2.NewSound(this, name));
}
function toString() {
return("newMovieClip");
}
var addedToParent = false;
}
Symbol 286 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewStage] Frame 0
class com.novelgames.flashgames.commonAS2.NewStage
{
var addedListener, onKeyDown, onKeyUp;
function NewStage () {
addedListener = false;
onKeyDown = null;
onKeyUp = null;
}
static function getNewStage() {
if (newStage == null) {
newStage = new com.novelgames.flashgames.commonAS2.NewStage();
}
return(newStage);
}
function get stageWidth() {
return(Stage.width);
}
function get stageHeight() {
return(Stage.height);
}
function set focus(object) {
Selection.setFocus(object);
//return(focus);
}
function get focus() {
return(Selection.getFocus());
}
function addEventListener(type, listenerObject, listenerFunctionName) {
if (!addedListener) {
Key.addListener(this);
addedListener = true;
}
switch (type) {
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN :
onKeyDown = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.KeyboardEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP :
onKeyUp = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.KeyboardEvent(this));
};
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN :
onKeyDown = null;
break;
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP :
onKeyUp = null;
}
}
static var newStage = null;
}
Symbol 287 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.KeyboardEvent] Frame 0
class com.novelgames.flashgames.commonAS2.KeyboardEvent
{
var target, currentTarget;
function KeyboardEvent (target) {
this.target = target;
currentTarget = target;
}
function get charCode() {
return(Key.getAscii());
}
function get keyCode() {
return(Key.getCode());
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var KEY_DOWN = "keyDown";
static var KEY_UP = "keyUp";
}
Symbol 288 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Rectangle] Frame 0
class com.novelgames.flashgames.commonAS2.Rectangle
{
var x, y, width, height;
function Rectangle (x, y, width, height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
function get left() {
return(x);
}
function set left(left) {
x = left;
//return(this.left);
}
function get top() {
return(y);
}
function set top(top) {
y = top;
//return(this.top);
}
function get right() {
return(x + width);
}
function set right(right) {
width = right - x;
//return(this.right);
}
function get bottom() {
return(y + height);
}
function set bottom(bottom) {
height = bottom - y;
//return(this.bottom);
}
function get size() {
return({x:width, y:height});
}
function set size(size) {
width = size.x;
height = size.y;
//return(this.size);
}
function get topLeft() {
return({x:x, y:y});
}
function set topLeft(topLeft) {
x = topLeft.x;
y = topLeft.y;
//return(this.topLeft);
}
function get bottomRight() {
return({x:x + width, y:y + height});
}
function set bottomRight(bottomRight) {
width = x - bottomRight.x;
height = y - bottomRight.y;
//return(this.bottomRight);
}
}
Symbol 289 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MouseEvent] Frame 0
class com.novelgames.flashgames.commonAS2.MouseEvent
{
var target, currentTarget;
function MouseEvent (target) {
this.target = target;
currentTarget = target;
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var CLICK = "click";
static var DOUBLE_CLICK = "doubleClick";
static var MOUSE_DOWN = "mouseDown";
static var MOUSE_MOVE = "mouseMove";
static var MOUSE_OUT = "mouseOut";
static var MOUSE_OVER = "mouseOver";
static var MOUSE_UP = "mouseUp";
static var MOUSE_WHEEL = "mouseWheel";
static var ROLL_OUT = "rollOut";
static var ROLL_OVER = "rollOver";
}
Symbol 290 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Event] Frame 0
class com.novelgames.flashgames.commonAS2.Event
{
function Event () {
}
static var ENTER_FRAME = "enterFrame";
}
Symbol 291 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.URLRequest] Frame 0
class com.novelgames.flashgames.commonAS2.URLRequest
{
var url;
function URLRequest (url) {
this.url = url;
}
}
Symbol 292 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewSound] Frame 0
class com.novelgames.flashgames.commonAS2.NewSound extends Sound
{
var attachSound, start;
function NewSound (target, symbolName) {
super(target);
attachSound(symbolName);
}
function play() {
start();
}
}
Symbol 293 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Jauge] Frame 0
class com.novelgames.flashgames.minigolfAS2.Jauge extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var jauge_anime;
function Jauge () {
super();
jauge_anime.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
trace("Jauge: " + jauge_anime);
}
function get length() {
return(jauge_anime._currentframe * 3);
}
function update(timerEvent) {
}
}
Symbol 294 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.TimerEvent] Frame 0
class com.novelgames.flashgames.commonAS2.TimerEvent
{
function TimerEvent () {
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var TIMER = "timer";
}
Symbol 295 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Block] Frame 0
class com.novelgames.flashgames.minigolfAS2.Block extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var stop, type, indexX, indexY, __set__x, __set__y, gotoAndStop, _visible;
function Block () {
super();
(stop());// not popped
}
function initialize(blockInfo) {
type = blockInfo.type;
indexX = blockInfo.x;
indexY = blockInfo.y;
__set__x(indexX * com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX);
__set__y(indexY * com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY);
switch (type) {
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_BALL :
(gotoAndStop("ball"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_HOLE :
(gotoAndStop("hole"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_LAND :
(gotoAndStop("land"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFT :
(gotoAndStop("slopeL"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHT :
(gotoAndStop("slopeR"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEUP :
(gotoAndStop("slopeU"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEDOWN :
(gotoAndStop("slopeD"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTUPOUT :
(gotoAndStop("slopeLUO"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTUPOUT :
(gotoAndStop("slopeRUO"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTDOWNOUT :
(gotoAndStop("slopeLDO"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTDOWNOUT :
(gotoAndStop("slopeRDO"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEALLOUT :
(gotoAndStop("slopeAO"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTUPIN :
(gotoAndStop("slopeLUI"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTUPIN :
(gotoAndStop("slopeRUI"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTDOWNIN :
(gotoAndStop("slopeLDI"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTDOWNIN :
(gotoAndStop("slopeRDI"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEALLIN :
(gotoAndStop("slopeAI"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_WALL :
(gotoAndStop("wall"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_HERBE :
(gotoAndStop("herbe"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_ARBRE1 :
(gotoAndStop("arbre1"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_ARBRE2 :
(gotoAndStop("arbre2"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_ARBRE3 :
(gotoAndStop("arbre3"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_ARBRE4 :
(gotoAndStop("arbre4"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_COCHON :
(gotoAndStop("cochon"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_MOUTON :
(gotoAndStop("mouton"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_POULE :
(gotoAndStop("poule"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_OBS_1 :
(gotoAndStop("obs_1"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_OBS_2 :
(gotoAndStop("obs_2"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_TOUF :
(gotoAndStop("touf"));// not popped
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_OUT :
_visible = false;
(gotoAndStop("wall"));// not popped
}
}
}
Symbol 296 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.BlockInfo] Frame 0
class com.novelgames.flashgames.minigolfAS2.BlockInfo
{
var x, y, type;
function BlockInfo (typeText, x, y) {
this.x = x;
this.y = y;
switch (typeText) {
case "0" :
type = TYPE_BLANK;
break;
case "1" :
type = TYPE_BALL;
break;
case "2" :
type = TYPE_HOLE;
break;
case "3" :
type = TYPE_LAND;
break;
case "4" :
type = TYPE_WALL;
break;
case "5" :
type = TYPE_SLOPELEFT;
break;
case "6" :
type = TYPE_SLOPERIGHT;
break;
case "7" :
type = TYPE_SLOPEUP;
break;
case "8" :
type = TYPE_SLOPEDOWN;
break;
case "9" :
type = TYPE_SLOPELEFTUPOUT;
break;
case "A" :
type = TYPE_SLOPERIGHTUPOUT;
break;
case "B" :
type = TYPE_SLOPELEFTDOWNOUT;
break;
case "C" :
type = TYPE_SLOPERIGHTDOWNOUT;
break;
case "D" :
type = TYPE_SLOPEALLOUT;
break;
case "E" :
type = TYPE_SLOPELEFTUPIN;
break;
case "F" :
type = TYPE_SLOPERIGHTUPIN;
break;
case "G" :
type = TYPE_SLOPELEFTDOWNIN;
break;
case "H" :
type = TYPE_SLOPERIGHTDOWNIN;
break;
case "I" :
type = TYPE_SLOPEALLIN;
break;
case "J" :
type = TYPE_HERBE;
break;
case "L" :
type = TYPE_ARBRE1;
break;
case "M" :
type = TYPE_ARBRE2;
break;
case "N" :
type = TYPE_COCHON;
break;
case "Q" :
type = TYPE_MOUTON;
break;
case "P" :
type = TYPE_POULE;
break;
case "S" :
type = TYPE_OBS_1;
break;
case "T" :
type = TYPE_OBS_2;
break;
case "K" :
type = TYPE_OUT;
break;
case "Z" :
type = TYPE_ARBRE3;
break;
case "Y" :
type = TYPE_ARBRE4;
break;
case "W" :
type = TYPE_OBS_3;
break;
case "R" :
type = TYPE_TOUF;
break;
default :
type = TYPE_BLANK;
}
}
function getIsBlankOrWall() {
return((type == TYPE_BLANK) || (type == TYPE_WALL));
}
static var TYPE_BLANK = 0;
static var TYPE_BALL = 1;
static var TYPE_HOLE = 2;
static var TYPE_LAND = 3;
static var TYPE_SLOPELEFT = 4;
static var TYPE_SLOPERIGHT = 5;
static var TYPE_SLOPEUP = 6;
static var TYPE_SLOPEDOWN = 7;
static var TYPE_SLOPELEFTUPOUT = 8;
static var TYPE_SLOPERIGHTUPOUT = 9;
static var TYPE_SLOPELEFTDOWNOUT = 10;
static var TYPE_SLOPERIGHTDOWNOUT = 11;
static var TYPE_SLOPEALLOUT = 12;
static var TYPE_SLOPELEFTUPIN = 13;
static var TYPE_SLOPERIGHTUPIN = 14;
static var TYPE_SLOPELEFTDOWNIN = 15;
static var TYPE_SLOPERIGHTDOWNIN = 16;
static var TYPE_SLOPEALLIN = 17;
static var TYPE_WALL = 18;
static var TYPE_HERBE = 19;
static var TYPE_ARBRE1 = 20;
static var TYPE_ARBRE2 = 21;
static var TYPE_COCHON = 22;
static var TYPE_MOUTON = 23;
static var TYPE_POULE = 24;
static var TYPE_OBS_1 = 25;
static var TYPE_OBS_2 = 26;
static var TYPE_OUT = 27;
static var TYPE_ARBRE3 = 28;
static var TYPE_ARBRE4 = 29;
static var TYPE_OBS_3 = 30;
static var TYPE_TOUF = 31;
static var TYPE_MAX = 32;
}
Symbol 297 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.InstructionsButton] Frame 0
class com.novelgames.flashgames.commonAS2.InstructionsButton extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var onRelease;
function InstructionsButton () {
super();
onRelease = function () {
this._parent._parent.showInstructionsFromGame();
};
}
}
Symbol 298 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MuteButton] Frame 0
class com.novelgames.flashgames.commonAS2.MuteButton extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var gotoAndStop;
function MuteButton () {
super();
if (new Sound().getVolume() == 0) {
showOff();
} else {
showOn();
}
}
function onPress() {
if (new Sound().getVolume() == 0) {
new Sound().setVolume(100);
showOn();
} else {
new Sound().setVolume(0);
showOff();
}
}
function showOff() {
(gotoAndStop("off"));// not popped
}
function showOn() {
(gotoAndStop("on"));// not popped
}
}
Symbol 299 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Ball] Frame 0
class com.novelgames.flashgames.minigolfAS2.Ball extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var soundBord1, createSound, soundBord2, indexX, indexY, blockX, blockY, speedX, speedY, accelerationX, accelerationY, __set__x, _parent, __set__y, __set__scaleX, __set__scaleY, lastMoveTime, b0, ballStopped, b1, b_current, b2, b3, b4, b1_s, b2_s, b3_s, b4_s, s_current, s_current_compute, __get__x, __get__y, x, y, ballStopTime;
function Ball () {
super();
soundBord1 = createSound("SoundBord1");
soundBord2 = createSound("SoundBord2");
}
function initialize(x, y) {
indexX = x;
indexY = y;
blockX = com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX / 2;
blockY = com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY / 2;
speedX = 0;
speedY = 0;
accelerationX = 0;
accelerationY = 0;
__set__x((_parent.blocksHolder.x + (x * com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX)) + (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX / 2));
__set__y((_parent.blocksHolder.y + (y * com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY)) + (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY / 2));
__set__scaleX(1);
__set__scaleY(1);
init();
inSpeed = false;
}
function startMoving(speedX, speedY) {
this.speedX = speedX;
this.speedY = speedY;
checkSpeed();
lastMoveTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
b0._visible = false;
ballStopped = false;
}
function SetMovieSpeed() {
var _local2 = _parent;
if (inSpeed) {
return(undefined);
}
inSpeed = true;
switch (b_current) {
case b1 :
_local2.SetMovieSpeed(1);
break;
case b2 :
_local2.SetMovieSpeed(2);
break;
case b3 :
_local2.SetMovieSpeed(3);
break;
case b4 :
_local2.SetMovieSpeed(4);
}
}
function RemoveMovieSpeed() {
inSpeed = false;
}
function getNormalMovieSpeed() {
switch (b_current) {
case b1 :
return(b1);
case b2 :
return(b2);
case b3 :
return(b3);
case b4 :
return(b4);
case b1_s :
return(b1);
case b2_s :
return(b2);
case b3_s :
return(b3);
case b4_s :
return(b4);
}
}
function checkSpeed() {
var _local4 = 1;
var _local3 = 1;
if (speedX < 0) {
_local4 = -1;
}
if (speedY < 0) {
_local3 = -1;
}
if ((speedX == 0) && (speedY == 0)) {
return(undefined);
}
if ((oldSpeedX != _local4) || (oldSpeedY != _local3)) {
oldSpeedX = _local4;
oldSpeedY = _local3;
b0._visible = false;
b1._visible = false;
b2._visible = false;
b3._visible = false;
b4._visible = false;
b1_s._visible = false;
b2_s._visible = false;
b3_s._visible = false;
b4_s._visible = false;
if (Math.abs(speedX) > Math.abs(speedY)) {
b_current = b1;
pos = 1;
dPos = 1;
if (speedX < 0) {
b_current = b4;
}
} else {
b_current = b3;
pos = 1;
dPos = 1;
if (speedY < 0) {
b_current = b2;
}
}
var _local2 = Math.sqrt((speedX * speedX) + (speedY * speedY)) * com.novelgames.flashgames.minigolfAS2.Config.BALL_BOUNCESPEEDRETAIN;
_local2 = Math.floor(_local2);
if (_local2) {
s_current = 2 * (1000 / _local2);
} else {
s_current = 30;
}
s_current = Math.floor(s_current);
if (s_current >= 30) {
s_current = 30;
}
s_current_compute = s_current;
b_current._visible = true;
b_current.play();
if (b_current == b4) {
b4.b5.play();
}
}
}
function stopAnime() {
b0.gotoAndStop(1);
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b4.b5.gotoAndStop(1);
b1_s.gotoAndStop(1);
b2_s.gotoAndStop(1);
b3_s.gotoAndStop(1);
b4_s.gotoAndStop(1);
}
function init() {
b0.gotoAndStop(1);
b1.gotoAndStop(1);
b2.gotoAndStop(1);
b3.gotoAndStop(1);
b4.gotoAndStop(1);
b4.b5.gotoAndStop(1);
b0._visible = true;
b1._visible = false;
b2._visible = false;
b3._visible = false;
b4._visible = false;
b1_s._visible = false;
b2_s._visible = false;
b3_s._visible = false;
b4_s._visible = false;
oldSpeedX = (oldSpeedY = 0);
b_current = null;
}
function move(time) {
var _local2 = time - lastMoveTime;
var _local6;
var _local5;
var _local11;
var _local10;
var _local9;
var _local3;
var _local8;
if (_parent.blocks[indexX][indexY].type == com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTUPOUT) {
speedX = speedX * 0.9;
speedY = speedY * 0.9;
}
_local6 = ((speedX * _local2) / 1000) + (((accelerationX * _local2) * _local2) / 2000000);
_local5 = ((speedY * _local2) / 1000) + (((accelerationY * _local2) * _local2) / 2000000);
_local11 = Math.floor(Math.abs(_local6) / com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS) + 1;
_local10 = Math.floor(Math.abs(_local5) / com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS) + 1;
_local9 = Math.max(_local11, _local10);
checkSpeed();
var _local7 = Math.sqrt((speedX * speedX) + (speedY * speedY));
if (((speedX == 0) && (speedY == 0)) || (_local7 < 0.1)) {
b_current.gotoAndStop(1);
if (b_current == b4) {
b4.b5.gotoAndStop(1);
}
init();
} else {
b_current.play();
if (b_current == b4) {
b4.b5.play();
}
}
if (_local9 > 1) {
move(lastMoveTime + ((time - lastMoveTime) / _local9));
return(move(time));
}
_local3 = getBounceInfo(__get__x(), __get__y(), __get__x() + _local6, __get__y() + _local5);
if (_local3) {
__set__x(_local3.x);
__set__y(_local3.y);
_local2 = (time - lastMoveTime) * _local3.timeRatio;
if (_local3.type >= com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_WALL) {
_local7 = Math.sqrt((speedX * speedX) + (speedY * speedY)) * com.novelgames.flashgames.minigolfAS2.Config.BALL_BOUNCESPEEDRETAIN;
if (_local7 > 100) {
if (_local7 > 500) {
soundBord1.play();
} else {
soundBord2.play();
}
}
}
} else {
x = x + _local6;
y = y + _local5;
}
indexX = Math.floor((__get__x() - _parent.blocksHolder.x) / com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX);
indexY = Math.floor((__get__y() - _parent.blocksHolder.y) / com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY);
blockX = (__get__x() - _parent.blocksHolder.x) - _parent.blocks[indexX][indexY].x;
blockY = (__get__y() - _parent.blocksHolder.y) - _parent.blocks[indexX][indexY].y;
speedX = speedX + ((accelerationX * _local2) / 1000);
speedY = speedY + ((accelerationY * _local2) / 1000);
if (_local3) {
_local8 = Math.sqrt((speedX * speedX) + (speedY * speedY)) * com.novelgames.flashgames.minigolfAS2.Config.BALL_BOUNCESPEEDRETAIN;
speedX = _local8 * _local3.directionX;
speedY = _local8 * _local3.directionY;
}
updateAccelerations();
updateSpeedsByFriction(_local2);
lastMoveTime = lastMoveTime + _local2;
if ((Math.abs(_local6 / _local2) < com.novelgames.flashgames.minigolfAS2.Config.BALL_NOTMOVETHRESHOLD) && (Math.abs(_local5 / _local2) < com.novelgames.flashgames.minigolfAS2.Config.BALL_NOTMOVETHRESHOLD)) {
if (!ballStopped) {
ballStopped = true;
ballStopTime = lastMoveTime;
// unexpected jump
}
return((lastMoveTime - ballStopTime) < com.novelgames.flashgames.minigolfAS2.Config.BALL_NOTMOVETIME);
} else {
ballStopped = false;
}
if (lastMoveTime < time) {
if (((_local2 == 0) && (Math.abs(speedX) < com.novelgames.flashgames.minigolfAS2.Config.BALL_NOTMOVETHRESHOLD)) && (Math.abs(speedY) < com.novelgames.flashgames.minigolfAS2.Config.BALL_NOTMOVETHRESHOLD)) {
return(false);
}
return(move(time));
}
return(true);
}
function updateAccelerations() {
accelerationX = 0;
accelerationY = 0;
switch (_parent.blocks[indexX][indexY].type) {
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFT :
accelerationX = -com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHT :
accelerationX = com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTDOWNIN :
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTUPIN :
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEUP :
accelerationY = -com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEDOWN :
accelerationY = com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTUPOUT :
if (blockX > blockY) {
accelerationY = -com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
} else {
accelerationX = -com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
}
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTUPOUT :
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTDOWNOUT :
accelerationY = com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTDOWNOUT :
accelerationY = com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEALLOUT :
accelerationX = com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPELEFTUPIN :
accelerationX = com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPERIGHTDOWNIN :
accelerationX = -com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
break;
case com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_SLOPEALLIN :
accelerationX = -com.novelgames.flashgames.minigolfAS2.Config.BALL_SLOPEACCELERATION;
}
}
function updateSpeedsByFriction(dTime) {
var _local2;
var _local3;
var _local4;
_local2 = Math.sqrt((speedX * speedX) + (speedY * speedY));
if (_local2 > 0) {
if (_parent.getBallIsAtHole()) {
_local3 = (com.novelgames.flashgames.minigolfAS2.Config.BALL_HOLEDECELERATION * Math.abs(speedX)) / _local2;
_local4 = (com.novelgames.flashgames.minigolfAS2.Config.BALL_HOLEDECELERATION * Math.abs(speedY)) / _local2;
} else {
_local3 = (com.novelgames.flashgames.minigolfAS2.Config.BALL_LANDDECELERATION * Math.abs(speedX)) / _local2;
_local4 = (com.novelgames.flashgames.minigolfAS2.Config.BALL_LANDDECELERATION * Math.abs(speedY)) / _local2;
}
if ((Math.abs(speedX) * 1000) < (_local3 * dTime)) {
speedX = 0;
} else {
speedX = speedX + (((((speedX > 0) ? -1 : 1) * _local3) * dTime) / 1000);
}
if ((Math.abs(speedY) * 1000) < (_local4 * dTime)) {
speedY = 0;
} else {
speedY = speedY + (((((speedY > 0) ? -1 : 1) * _local4) * dTime) / 1000);
}
}
}
function getBounceInfo(fromX, fromY, toX, toY) {
var _local4 = null;
var _local2 = null;
var _local12;
var _local13;
var _local7;
var _local6;
var _local5;
var _local3;
_local12 = Math.floor((Math.min(fromX, toX) - _parent.blocksHolder.x) / com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX);
_local13 = Math.floor((Math.max(fromX, toX) - _parent.blocksHolder.x) / com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX);
_local7 = Math.floor((Math.min(fromY, toY) - _parent.blocksHolder.y) / com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY);
_local6 = Math.floor((Math.max(fromY, toY) - _parent.blocksHolder.y) / com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY);
if (_local12 > 0) {
_local12--;
}
if (_local13 < (_parent.blocks.length - 1)) {
_local13++;
}
if (_local7 > 0) {
_local7--;
}
if (_local6 < (_parent.blocks[0].length - 1)) {
_local6++;
}
_local5 = _local12;
while (_local5 <= _local13) {
_local3 = _local7;
while (_local3 <= _local6) {
_local2 = getBlockBounceInfo(_parent.blocks[_local5][_local3], fromX, fromY, toX, toY);
if (!_local2) {
} else if ((!_local4) || (_local2.timeRatio < _local4.timeRatio)) {
_local4 = _local2;
}
_local3++;
}
_local5++;
}
return(_local4);
}
function getBlockBounceInfo(block, fromX, fromY, toX, toY) {
var _local2 = null;
var _local4;
var _local10;
var _local9;
if ((block.type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_WALL) && (block.type < com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_ARBRE1)) {
return(null);
}
fromX = fromX - (_parent.blocksHolder.x + block.__get__x());
fromY = fromY - (_parent.blocksHolder.y + block.__get__y());
toX = toX - (_parent.blocksHolder.x + block.__get__x());
toY = toY - (_parent.blocksHolder.y + block.__get__y());
if ((fromX <= (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (toX > (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local4 = ((-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS) - fromX) / (toX - fromX);
_local9 = (fromY * (1 - _local4)) + (toY * _local4);
if ((_local9 >= (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (_local9 <= (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local2 = new com.novelgames.flashgames.minigolfAS2.BounceInfo();
_local2.x = (_parent.blocksHolder.x + block.__get__x()) - com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS;
_local2.y = (_parent.blocksHolder.y + block.__get__y()) + _local9;
fillDirection(_local2, fromX, fromY, toX, toY);
_local2.directionX = -_local2.directionX;
_local2.timeRatio = _local4;
_local2.type = block.type;
return(_local2);
}
}
if ((fromY <= (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (toY > (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local4 = ((-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS) - fromY) / (toY - fromY);
_local10 = (fromX * (1 - _local4)) + (toX * _local4);
if ((_local10 >= (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (_local10 <= (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local2 = new com.novelgames.flashgames.minigolfAS2.BounceInfo();
_local2.x = (_parent.blocksHolder.x + block.__get__x()) + _local10;
_local2.y = (_parent.blocksHolder.y + block.__get__y()) - com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS;
fillDirection(_local2, fromX, fromY, toX, toY);
_local2.directionY = -_local2.directionY;
_local2.timeRatio = _local4;
_local2.type = block.type;
return(_local2);
}
}
if ((fromX >= (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (toX < (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local4 = ((fromX - com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX) - com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS) / (fromX - toX);
_local9 = (fromY * (1 - _local4)) + (toY * _local4);
if ((_local9 >= (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (_local9 <= (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local2 = new com.novelgames.flashgames.minigolfAS2.BounceInfo();
_local2.x = ((_parent.blocksHolder.x + block.__get__x()) + com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX) + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS;
_local2.y = (_parent.blocksHolder.y + block.__get__y()) + _local9;
fillDirection(_local2, fromX, fromY, toX, toY);
_local2.directionX = -_local2.directionX;
_local2.timeRatio = _local4;
_local2.type = block.type;
return(_local2);
}
}
if ((fromY >= (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (toY < (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local4 = ((fromY - com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY) - com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS) / (fromY - toY);
_local10 = (fromX * (1 - _local4)) + (toX * _local4);
if ((_local10 >= (-com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS)) && (_local10 <= (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS))) {
_local2 = new com.novelgames.flashgames.minigolfAS2.BounceInfo();
_local2.x = (_parent.blocksHolder.x + block.__get__x()) + _local10;
_local2.y = ((_parent.blocksHolder.y + block.__get__y()) + com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY) + com.novelgames.flashgames.minigolfAS2.Config.BALL_RADIUS;
fillDirection(_local2, fromX, fromY, toX, toY);
_local2.directionY = -_local2.directionY;
_local2.timeRatio = _local4;
_local2.type = block.type;
return(_local2);
}
}
return(null);
}
function fillDirection(bounceInfo, fromX, fromY, toX, toY) {
var _local2 = toX - fromX;
var _local1 = toY - fromY;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
bounceInfo.directionX = _local2 / _local3;
bounceInfo.directionY = _local1 / _local3;
}
var dPos = 1;
var pos = 0;
var inSpeed = false;
var speedAnimCount = 0;
var oldSpeedX = 1;
var oldspeedY = 1;
}
Symbol 300 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Timer] Frame 0
interface com.novelgames.flashgames.commonAS2.Timer
{
}
Symbol 301 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewTimer] Frame 0
class com.novelgames.flashgames.commonAS2.NewTimer implements com.novelgames.flashgames.commonAS2.Timer
{
static var pauseTime;
var delay, repeatCount, currentCount, listenerObject, listenerFunctionName, adjustedStartTime, usingDelay, intervalID;
function NewTimer (delay, repeatCount) {
if (repeatCount == undefined) {
repeatCount = 0;
}
this.delay = delay;
this.repeatCount = repeatCount;
currentCount = 0;
}
static function getTimer() {
if (paused) {
return(pauseTime - totalPausedTime);
}
return(getTimer() - totalPausedTime);
}
static function pause() {
if (paused) {
return(undefined);
}
paused = true;
pauseTime = getTimer();
}
static function unpause() {
if (!paused) {
return(undefined);
}
paused = false;
totalPausedTime = totalPausedTime + (getTimer() - pauseTime);
}
function addEventListener(type, listenerObject, listenerFunctionName) {
if (type != com.novelgames.flashgames.commonAS2.TimerEvent.TIMER) {
return(undefined);
}
this.listenerObject = listenerObject;
this.listenerFunctionName = listenerFunctionName;
}
function removeEventListener(type) {
if (type != com.novelgames.flashgames.commonAS2.TimerEvent.TIMER) {
return(undefined);
}
listenerObject = null;
listenerFunctionName = null;
}
function start() {
adjustedStartTime = getTimer();
usingDelay = delay;
clearInterval(intervalID);
intervalID = setInterval(this, "timerEventListener", delay);
}
function stop() {
clearInterval(intervalID);
}
function toString() {
return(("NewTimer : " + intervalID) + "");
}
function timerEventListener() {
currentCount++;
if (paused) {
clearInterval(intervalID);
usingDelay = Math.max(delay - (getTimer() - adjustedStartTime), 1);
currentCount--;
intervalID = setInterval(this, "timerEventListener", usingDelay);
return(undefined);
}
if ((getTimer() - adjustedStartTime) >= delay) {
adjustedStartTime = getTimer();
if (usingDelay != delay) {
clearInterval(intervalID);
usingDelay = delay;
intervalID = setInterval(this, "timerEventListener", usingDelay);
}
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.TimerEvent());
if ((repeatCount != 0) && (currentCount >= repeatCount)) {
clearInterval(intervalID);
}
} else {
clearInterval(intervalID);
usingDelay = Math.max(delay - (getTimer() - adjustedStartTime), 1);
currentCount--;
intervalID = setInterval(this, "timerEventListener", usingDelay);
}
}
static var paused = false;
static var totalPausedTime = 0;
}
Symbol 302 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.BounceInfo] Frame 0
class com.novelgames.flashgames.minigolfAS2.BounceInfo
{
function BounceInfo () {
}
}
Symbol 303 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Message] Frame 0
class com.novelgames.flashgames.minigolfAS2.Message extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var stop, hole, gotoAndStop, messageHole, createMovie, addChild, messageResult, parTexts, shotsTexts, messagePlayAgain, removeChild, _parent, getURL;
function Message () {
super();
(stop());// not popped
}
function showHole(hole) {
hide();
this.hole = hole;
(gotoAndStop("background"));// not popped
messageHole = com.novelgames.flashgames.minigolfAS2.MessageHole(createMovie("MessageHole"));
messageHole.holeText.text = hole.toString();
addChild(messageHole);
}
function showResult(par, shots, holeShots) {
var _local5 = shots - par;
var _local2;
hide();
(gotoAndStop("background"));// not popped
messageResult = com.novelgames.flashgames.minigolfAS2.MessageResult(createMovie("MessageResult"));
messageResult.holeLabel.text = chapatiz.utils.Localisation.localString("BIRDIZ_HOLELABEL");
messageResult.parLabel.text = chapatiz.utils.Localisation.localString("BIRDIZ_PARLABEL");
messageResult.shotsLabel.text = chapatiz.utils.Localisation.localString("BIRDIZ_SHOTSLABEL");
var _local3;
if (shots == 1) {
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_HOLEINONE");
} else {
switch (_local5) {
case 0 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_PAR");
break;
case -1 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_BIRDIE");
break;
case -2 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_EAGLE");
break;
case -3 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_TURKEY");
break;
case -4 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_OSPREY");
break;
case -5 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_OSTRICH");
break;
case 1 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_BOGEY");
break;
case 2 :
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_DOUBLEBOGEY");
break;
default :
if (_local5 <= 0) {
} else {
}
_local3 = chapatiz.utils.Localisation.localString("BIRDIZ_PARNAME_GOOD");
}
}
messageResult.message.text = _local3;
parTexts = new Array();
shotsTexts = new Array();
_local2 = 0;
while (_local2 < com.novelgames.flashgames.minigolfAS2.Config.FIELD_INFOS.length) {
parTexts[_local2] = messageResult["parText" + _local2];
shotsTexts[_local2] = messageResult["shotsText" + _local2];
parTexts[_local2].text = com.novelgames.flashgames.minigolfAS2.Config.FIELD_INFOS[_local2][0];
if (_local2 >= holeShots.length) {
} else {
(holeShots[_local2]);// not popped
}
shotsTexts[_local2].text = "";
_local2++;
}
messageResult.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN, this, "hideResult");
addChild(messageResult);
}
function showPlayAgain(score) {
hide();
(gotoAndStop("background"));// not popped
messagePlayAgain = com.novelgames.flashgames.minigolfAS2.MessagePlayAgain(createMovie("MessagePlayAgain"));
messagePlayAgain.playAgainButton.onReleaseMC = chapatiz.utils.Delegate.create(this, playAgainButtonClicked);
messagePlayAgain.homeButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "homeButtonClicked");
messagePlayAgain.bt_chapatiz.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "gotoChapatiz");
messagePlayAgain.scoreValue.text = score + "";
messagePlayAgain.scoreText_0.text = chapatiz.utils.Localisation.localString("BIRDIZ_SCORE0");
messagePlayAgain.scoreText_1.text = chapatiz.utils.Localisation.localString("BIRDIZ_SCORE1");
messagePlayAgain.playAgainButton.__set__text(chapatiz.utils.Localisation.localString("BIRDIZ_REPLAY"));
addChild(messagePlayAgain);
}
function hide() {
if (messageHole) {
removeChild(messageHole);
messageHole = null;
}
if (messageResult) {
removeChild(messageResult);
messageResult = null;
}
(gotoAndStop("hide"));// not popped
}
function hideResult(mouseEvent) {
messageResult.removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN);
_parent.startNextHole();
}
function playAgainButtonClicked(mouseEvent) {
_parent._parent.gotoGamePage();
}
function homeButtonClicked(mouseEvent) {
_parent._parent.gotoTitlePage();
}
function gotoChapatiz(mouseEvent) {
getURL(com.novelgames.flashgames.minigolfAS2.Config.URL_REDIRECT + "/?from=cgptl", "_blank");
}
}
Symbol 304 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.MessageHole] Frame 0
class com.novelgames.flashgames.minigolfAS2.MessageHole extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var holeText, t;
function MessageHole () {
super();
holeText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
t.text = chapatiz.utils.Localisation.localString("BIRDIZ_LAND");
}
}
Symbol 305 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewTextField] Frame 0
class com.novelgames.flashgames.commonAS2.NewTextField extends TextField
{
var _x, _y, _rotation, _visible, _alpha, _width, _height, scroll, maxscroll;
function NewTextField () {
super();
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set rotation(rotation) {
_rotation = rotation;
//return(this.rotation);
}
function get rotation() {
return(_rotation);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get width() {
return(_width);
}
function set width(width) {
_width = width;
//return(this.width);
}
function get height() {
return(_height);
}
function set height(height) {
_height = height;
//return(this.height);
}
function set scrollV(scrollV) {
scroll = scrollV;
//return(this.scrollV);
}
function get scrollV() {
return(scroll);
}
function set maxScrollV(maxScrollV) {
maxscroll = maxScrollV;
//return(this.maxScrollV);
}
function get maxScrollV() {
return(maxscroll);
}
function setTextFormat(textFormat, beginIndex, endIndex) {
if ((beginIndex == undefined) || (endIndex == undefined)) {
super.setTextFormat(textFormat);
} else {
super.setTextFormat(beginIndex, endIndex, textFormat);
}
}
}
Symbol 306 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.MessageResult] Frame 0
class com.novelgames.flashgames.minigolfAS2.MessageResult extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var resultText, parText0, shotsText0, parText1, shotsText1, parText2, shotsText2, parText3, shotsText3, parText4, shotsText4, parText5, shotsText5, parText6, shotsText6, parText7, shotsText7, parText8, shotsText8;
function MessageResult () {
super();
resultText.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
parText0.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText0.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText1.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText1.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText2.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText2.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText3.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText3.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText4.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText4.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText5.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText5.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText6.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText6.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText7.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText7.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText8.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText8.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
}
}
Symbol 307 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.MessagePlayAgain] Frame 0
class com.novelgames.flashgames.minigolfAS2.MessagePlayAgain extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var playAgainButton, bt_chapatiz;
function MessagePlayAgain () {
super();
playAgainButton.__proto__ = chapatiz.display.MCButton.prototype;
homeButton.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
bt_chapatiz.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
}
Symbol 308 MovieClip [__Packages.chapatiz.utils.Delegate] Frame 0
class chapatiz.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local4 = arguments.callee.func;
var _local3 = arguments.callee.args;
return(_local4.apply(_local2, arguments.concat(_local3)));
};
_local2.target = obj;
_local2.func = func;
_local2.args = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 309 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Arrow] Frame 0
class com.novelgames.flashgames.minigolfAS2.Arrow extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var arrowMask, rotation, __get__mouseY, __get__mouseX, length;
function Arrow () {
super();
arrowMask.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
function update() {
rotation = rotation + ((Math.atan2(-__get__mouseY(), -__get__mouseX()) * 180) / Math.PI);
length = com.novelgames.flashgames.minigolfAS2.Config.BALL_MAXARROWLENGTH;
arrowMask.__set__x(-length);
}
}
Symbol 310 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.CommonGame] Frame 0
class com.novelgames.flashgames.commonAS2.CommonGame extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function CommonGame () {
super();
}
static function get gameStage() {
return(com.novelgames.flashgames.commonAS2.NewStage.getNewStage());
}
function pause() {
com.novelgames.flashgames.commonAS2.NewTimer.pause();
}
function unpause() {
com.novelgames.flashgames.commonAS2.NewTimer.unpause();
}
}
Symbol 311 MovieClip [__Packages.com.novelgames.flashgames.minigolfAS2.Game] Frame 0
class com.novelgames.flashgames.minigolfAS2.Game extends com.novelgames.flashgames.commonAS2.CommonGame
{
var message, clickDetector, scoreText, parText, shotsText, arrow, ball, blocksHolder, jauge, panelText, holeShots, soundShoot, createSound, soundHole, __score, __par, __shots, blocks, currentHole, _parent, pouletAnime, debut, intervalID, b3_s, b2_s, b1_s, b4_s, intervalIDSpeed, addEventListener, removeEventListener, poulet, startDropTime;
function Game () {
super();
_root._game = this;
message.__proto__ = com.novelgames.flashgames.minigolfAS2.Message.prototype;
clickDetector.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
scoreText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
parText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
shotsText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
arrow.__proto__ = com.novelgames.flashgames.minigolfAS2.Arrow.prototype;
ball.__proto__ = com.novelgames.flashgames.minigolfAS2.Ball.prototype;
blocksHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
jauge.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
ball.init();
score = (0);
panelText.scoreLabel.text = chapatiz.utils.Localisation.localString("BIRDIZ_SCORELABEL");
panelText.parLabel.text = chapatiz.utils.Localisation.localString("BIRDIZ_PARLABEL");
panelText.shotsLabel.text = chapatiz.utils.Localisation.localString("BIRDIZ_SHOTSLABEL");
holeShots = new Array();
soundShoot = createSound("SoundShoot");
soundHole = createSound("SoundHole");
ball._visible = false;
startHole(1);
setZClipping();
}
function set score(score) {
__score = score;
scoreText.text = score.toString();
//return(this.score);
}
function get score() {
return(__score);
}
function set par(par) {
__par = par;
parText.text = par.toString();
//return(this.par);
}
function get par() {
return(__par);
}
function set shots(shots) {
__shots = shots;
shotsText.text = shots.toString();
//return(this.shots);
}
function get shots() {
return(__shots);
}
function getBallIsAtHole() {
var _local3;
var _local2;
if (blocks[ball.indexX][ball.indexY].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_HOLE) {
return(false);
}
_local3 = ball.blockX - (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX / 2);
_local2 = ball.blockY - (com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY / 2);
return(((_local3 * _local3) + (_local2 * _local2)) < (com.novelgames.flashgames.minigolfAS2.Config.HOLE_RADIUS * com.novelgames.flashgames.minigolfAS2.Config.HOLE_RADIUS));
}
function startNextHole() {
var _local2 = shots - par;
switch (_local2) {
case 0 :
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_PAR;
break;
case -1 :
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_BIRDIE;
break;
case -2 :
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_EAGLE;
break;
case -3 :
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_TURKEY;
break;
case -4 :
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_OSPREY;
break;
case -5 :
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_OSTRICH;
break;
default :
if (_local2 >= 0) {
break;
}
score = score + com.novelgames.flashgames.minigolfAS2.Config.SCORE_GOOD;
}
if (currentHole >= com.novelgames.flashgames.minigolfAS2.Config.FIELD_INFOS.length) {
if (!com.novelgames.flashgames.minigolfAS2.Config.GAME_INCHAPALAND) {
message.showPlayAgain(score);
}
_parent.showEnterHighScore(score);
} else {
startHole(currentHole + 1);
}
}
function startHole(hole) {
var _local4;
var _local3;
var _local2;
currentHole = hole;
par = (com.novelgames.flashgames.minigolfAS2.Config.FIELD_INFOS[hole - 1][0]);
shots = (0);
pouletAnime._visible = false;
pouletAnime.gotoAndStop(1);
createBlocks(com.novelgames.flashgames.minigolfAS2.Config.FIELD_INFOS[hole - 1][1]);
_local4 = false;
_local3 = 0;
while (_local3 < blocks.length) {
_local2 = 0;
while (_local2 < blocks[_local3].length) {
if (!blocks[_local3][_local2]) {
} else if (blocks[_local3][_local2].type == com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_BALL) {
_local4 = true;
debut = blocks[_local3][_local2];
break;
}
_local2++;
}
if (_local4) {
break;
}
_local3++;
}
ball.initialize(_local3, _local2);
message.showHole(hole);
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.minigolfAS2.Config.MESSAGE_HOLETIME, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "startAim");
intervalID.start();
}
function SetMovieSpeed(n) {
var _local3 = Math.abs(n);
var _local2;
if ((_local3 >= 0.5) && (_local3 <= 1.5)) {
if (n > 0) {
_local2 = b3_s;
} else {
_local2 = b2_s;
}
} else if (n > 0) {
_local2 = b1_s;
} else {
_local2 = b4_s;
}
_local2._visible = true;
_local2._x = ball._x - 15;
_local2._y = ball._y - 15;
intervalIDSpeed = new com.novelgames.flashgames.commonAS2.NewTimer(500, 0);
intervalIDSpeed.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "speedStop");
intervalIDSpeed.start();
}
function speedStop(timerEvent) {
intervalIDSpeed.stop();
b1_s._visible = false;
b2_s._visible = false;
b3_s._visible = false;
b4_s._visible = false;
ball.RemoveMovieSpeed();
}
function createBlocks(infoText) {
var _local4;
var _local12;
var _local10;
var _local5;
var _local8;
var _local2;
var _local3;
var _local6 = new Array();
var _local9 = new Array();
_local4 = createBlockInfos(infoText);
surroundFieldWithWalls(_local4);
if (blocks) {
_local2 = 0;
while (_local2 < blocks.length) {
_local3 = 0;
while (_local3 < blocks[_local2].length) {
if (!blocks[_local2][_local3]) {
} else {
blocksHolder.removeChild(blocks[_local2][_local3]);
}
_local3++;
}
_local2++;
}
}
blocks = new Array(_local4.length);
_local2 = 0;
while (_local2 < _local4.length) {
blocks[_local2] = new Array(_local4[_local2].length);
_local3 = 0;
while (_local3 < _local4[_local2].length) {
if (_local4[_local2][_local3].type == com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_BLANK) {
} else if ((_local4[_local2][_local3].type < com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_ARBRE1) && (_local4[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_HOLE)) {
var _local7 = blocksHolder.createMovie("Block");
_local5 = _local7;
_local5.initialize(_local4[_local2][_local3]);
blocksHolder.addChild(_local5);
blocks[_local2][_local3] = _local5;
} else {
_local6.push([_local4[_local2][_local3], _local2, _local3]);
}
_local3++;
}
_local2++;
}
_local2 = 0;
while (_local2 < _local6.length) {
var _local7 = blocksHolder.createMovie("Block");
_local5 = _local7;
_local5.initialize(_local6[_local2][0]);
blocksHolder.addChild(_local5);
blocks[_local6[_local2][1]][_local6[_local2][2]] = _local5;
_local2++;
}
_local2 = 0;
while (_local2 < blocks.length) {
_local3 = 0;
while (_local3 < blocks[_local2].length) {
if (!blocks[_local2][_local3]) {
} else if (((blocks[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_WALL) || (blocks[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_OUT)) || (blocks[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_HERBE)) {
} else {
blocksHolder.setChildIndex(blocks[_local2][_local3], blocksHolder.__get__numChildren() - 1);
}
_local3++;
}
_local2++;
}
_local8 = blocksHolder.getBounds(blocksHolder);
blocksHolder.__set__x((com.novelgames.flashgames.minigolfAS2.Config.FIELD_LEFT + (((com.novelgames.flashgames.minigolfAS2.Config.FIELD_RIGHT - com.novelgames.flashgames.minigolfAS2.Config.FIELD_LEFT) - _local8.width) / 2)) - _local8.x);
blocksHolder.__set__y((com.novelgames.flashgames.minigolfAS2.Config.FIELD_TOP + (((com.novelgames.flashgames.minigolfAS2.Config.FIELD_BOTTOM - com.novelgames.flashgames.minigolfAS2.Config.FIELD_TOP) - _local8.height) / 2)) - _local8.y);
}
function createBlockInfos(infoText) {
var _local5;
var _local3;
var _local4;
var _local6;
var _local1;
var _local2;
_local4 = 0;
_local3 = infoText.split(newline);
_local1 = 0;
while (_local1 < _local3.length) {
if (_local3[_local1].length == 0) {
_local3.splice(_local1, 1);
_local1--;
} else if (_local3[_local1].length > _local4) {
_local4 = _local3[_local1].length;
}
_local1++;
}
_local6 = _local3.length;
_local5 = new Array(_local4);
_local1 = 0;
while (_local1 < _local4) {
_local5[_local1] = new Array(_local6);
_local2 = 0;
while (_local2 < _local6) {
_local5[_local1][_local2] = new com.novelgames.flashgames.minigolfAS2.BlockInfo(_local3[_local2].charAt(_local1), _local1, _local2);
_local2++;
}
_local1++;
}
return(_local5);
}
function surroundFieldWithWalls(blockInfos) {
var _local6;
var _local7;
var _local5;
var _local2;
var _local3;
_local2 = 0;
while (_local2 < blockInfos.length) {
_local3 = 0;
while (_local3 < blockInfos[_local2].length) {
blockInfos[_local2][_local3].x++;
blockInfos[_local2][_local3].y++;
_local3++;
}
_local2++;
}
_local2 = 0;
while (_local2 < blockInfos.length) {
_local6 = new com.novelgames.flashgames.minigolfAS2.BlockInfo(null, _local2 + 1, 0);
blockInfos[_local2].unshift(_local6);
_local6 = new com.novelgames.flashgames.minigolfAS2.BlockInfo(null, _local2 + 1, blockInfos[_local2].length);
blockInfos[_local2].push(_local6);
_local2++;
}
_local7 = new Array(blockInfos[0].length);
_local2 = 0;
while (_local2 < _local7.length) {
_local6 = new com.novelgames.flashgames.minigolfAS2.BlockInfo(null, 0, _local2);
_local7[_local2] = _local6;
_local2++;
}
blockInfos.unshift(_local7);
_local7 = new Array(blockInfos[0].length);
_local2 = 0;
while (_local2 < _local7.length) {
_local6 = new com.novelgames.flashgames.minigolfAS2.BlockInfo(null, blockInfos.length, _local2);
_local7[_local2] = _local6;
_local2++;
}
blockInfos.push(_local7);
_local2 = 0;
while (_local2 < blockInfos.length) {
_local3 = 0;
while (_local3 < blockInfos[_local2].length) {
if (((blockInfos[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_BLANK) || (blocks[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_OUT)) || (blocks[_local2][_local3].type != com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_HERBE)) {
} else {
_local5 = false;
if (((_local2 > 0) && (_local3 > 0)) && (!blockInfos[_local2 - 1][_local3 - 1].getIsBlankOrWall())) {
_local5 = true;
}
if ((_local3 > 0) && (!blockInfos[_local2][_local3 - 1].getIsBlankOrWall())) {
_local5 = true;
}
if (((_local2 < (blockInfos.length - 1)) && (_local3 > 0)) && (!blockInfos[_local2 + 1][_local3 - 1].getIsBlankOrWall())) {
_local5 = true;
}
if ((_local2 > 0) && (!blockInfos[_local2 - 1][_local3].getIsBlankOrWall())) {
_local5 = true;
}
if ((_local2 < (blockInfos.length - 1)) && (!blockInfos[_local2 + 1][_local3].getIsBlankOrWall())) {
_local5 = true;
}
if (((_local2 > 0) && (_local3 < (blockInfos[_local2].length - 1))) && (!blockInfos[_local2 - 1][_local3 + 1].getIsBlankOrWall())) {
_local5 = true;
}
if ((_local3 < (blockInfos[_local2].length - 1)) && (!blockInfos[_local2][_local3 + 1].getIsBlankOrWall())) {
_local5 = true;
}
if (((_local2 < (blockInfos.length - 1)) && (_local3 < (blockInfos[_local2].length - 1))) && (!blockInfos[_local2 + 1][_local3 + 1].getIsBlankOrWall())) {
_local5 = true;
}
if (_local5) {
blockInfos[_local2][_local3].type = com.novelgames.flashgames.minigolfAS2.BlockInfo.TYPE_WALL;
}
}
_local3++;
}
_local2++;
}
}
function startAim(timerEvent) {
intervalID.stop();
message.hide();
arrow.__set__x(ball.x);
arrow.__set__y(ball.y);
arrow.__set__visible(true);
arrow.update();
addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE, this, "onAimMouseMove");
clickDetector.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN, this, "onAimMouseDown");
jauge._visible = true;
ball.init();
jauge._x = ball._x - 40;
jauge._y = (ball._y + 20) - 4;
}
function onAimMouseMove(mouseEvent) {
if (!arrowNo) {
arrow.update();
}
mouseEvent.updateAfterEvent();
}
function onAimMouseDown(mouseEvent) {
arrowNo = true;
jauge._visible = false;
arrow._visible = false;
arrowNo = false;
var _local2 = (com.novelgames.flashgames.minigolfAS2.Config.BALL_MAXSHOOTSPEED * jauge.length) / com.novelgames.flashgames.minigolfAS2.Config.BALL_MAXARROWLENGTH;
debut.poussin._visible = false;
ball._visible = true;
shots = ((shots+1));
ball.startMoving(_local2 * Math.cos((arrow.__get__rotation() * Math.PI) / 180), _local2 * Math.sin((arrow.__get__rotation() * Math.PI) / 180));
trace("length: " + jauge.length);
if (jauge.length > 50) {
SetMovieSpeed(arrow.__get__rotation() / 90);
}
removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE);
clickDetector.removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN);
soundShoot.play();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onMoveTime");
intervalID.start();
}
function setPoulet(p, x, y) {
p._visible = false;
p._alpha = 50;
poulet = pouletAnime;
pouletAnime._x = x;
pouletAnime._y = y;
pouletAnime._visible = true;
}
function setZClipping() {
var _local2 = poulet.getDepth();
var _local3 = ball.getDepth();
var _local4 = poulet._y + 45;
if (ball._y > _local4) {
if (_local2 > _local3) {
poulet.swapDepths(_local3);
ball.swapDepths(_local2);
}
} else if (_local2 < _local3) {
poulet.swapDepths(_local3);
ball.swapDepths(_local2);
}
}
function onMoveTime(timerEvent) {
var _local2 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local3;
_local3 = ball.move(_local2);
setZClipping();
if (getBallIsAtHole()) {
ball._visible = false;
if ((ball.speedX == 0) && (ball.speedY == 0)) {
dropBallToHole();
}
} else {
ball._visible = true;
if (!_local3) {
startAim(null);
}
}
timerEvent.updateAfterEvent();
}
function dropBallToHole() {
ball.stopAnime();
poulet.playAnime();
ball._visible = false;
intervalID.stop();
startDropTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
soundHole.play();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(500, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onDropTime");
intervalID.start();
}
function onDropTime(timerEvent) {
var _local3 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer() - startDropTime;
var _local2;
var _local4;
if (_local3 >= com.novelgames.flashgames.minigolfAS2.Config.BALL_DROPHOLETIME) {
showResult();
} else {
_local2 = _local3 / com.novelgames.flashgames.minigolfAS2.Config.BALL_DROPHOLETIME;
ball.__set__x(((blocksHolder.__get__x() + blocks[ball.indexX][ball.indexY].x) + (ball.blockX * (1 - _local2))) + ((com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEX / 2) * _local2));
ball.__set__y(((blocksHolder.__get__y() + blocks[ball.indexX][ball.indexY].y) + (ball.blockY * (1 - _local2))) + ((com.novelgames.flashgames.minigolfAS2.Config.FIELD_BLOCKSIZEY / 2) * _local2));
_local4 = ((100 * (1 - _local2)) + (com.novelgames.flashgames.minigolfAS2.Config.BALL_ATHOLESCALE * _local2)) / 100;
ball.__set__scaleX(_local4);
ball.__set__scaleY(_local4);
}
timerEvent.updateAfterEvent();
}
function showResult() {
intervalID.stop();
holeShots[currentHole - 1] = shots;
message.showResult(par, shots, holeShots);
}
var arrowNo = false;
}