Frame 1
if (this.inited == undefined) {
this.inited = true;
com.novelgames.flashgames.MainSpookizDemo.initialize(this);
this.getEnterPosition = function (from_str) {
if (from_str.substr(0, 3) == "bg_") {
from_str = "bacteria_game";
}
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 7 MovieClip [InstructionsButton] Frame 1
#initclip 45
Object.registerClass("InstructionsButton", com.novelgames.flashgames.commonAS2.InstructionsButton);
#endinitclip
Symbol 11 MovieClip [MuteButton] Frame 1
#initclip 35
Object.registerClass("MuteButton", com.novelgames.flashgames.commonAS2.MuteButton);
#endinitclip
Symbol 13 MovieClip [empty] Frame 1
#initclip 36
Object.registerClass("empty", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 20 MovieClip [GameOverDialog] Frame 1
#initclip 37
Object.registerClass("GameOverDialog", com.novelgames.flashgames.spookiz.GameOverDialog);
#endinitclip
Symbol 21 MovieClip [Game] Frame 1
#initclip 38
Object.registerClass("Game", com.novelgames.flashgames.spookiz.Game);
#endinitclip
Symbol 22 MovieClip [Column] Frame 1
#initclip 39
Object.registerClass("Column", com.novelgames.flashgames.spookiz.Column);
#endinitclip
Symbol 34 MovieClip Frame 11
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 7
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 13
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 6
stop();
Symbol 119 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 4
stop();
Symbol 126 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 8
stop();
Symbol 138 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 6
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 8
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 4
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 169 MovieClip [Block] Frame 1
#initclip 40
Object.registerClass("Block", com.novelgames.flashgames.spookiz.Block);
#endinitclip
Symbol 183 MovieClip [Title] Frame 1
#initclip 41
Object.registerClass("Title", com.novelgames.flashgames.commonAS2.Title);
#endinitclip
Symbol 190 MovieClip [MessagePlayAgain] Frame 1
#initclip 42
Object.registerClass("MessagePlayAgain", com.novelgames.flashgames.spookiz.MessagePlayAgain);
#endinitclip
Symbol 231 MovieClip Frame 2
stop();
Symbol 231 MovieClip Frame 11
stop();
Symbol 231 MovieClip Frame 21
stop();
Symbol 232 MovieClip [ascensseur] Frame 1
#initclip 43
Object.registerClass("ascensseur", com.novelgames.flashgames.spookiz.Ascensseur);
#endinitclip
Symbol 232 MovieClip [ascensseur] Frame 14
stop();
Symbol 232 MovieClip [ascensseur] Frame 40
stop();
Symbol 232 MovieClip [ascensseur] Frame 65
stop();
Symbol 232 MovieClip [ascensseur] Frame 80
stop();
Symbol 235 MovieClip [empty] Frame 1
#initclip 44
Object.registerClass("empty", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 322 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 103
gotoAndStop (1);
Symbol 333 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 103
gotoAndStop (1);
Symbol 337 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 338 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 339 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 340 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 341 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 342 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 343 MovieClip [__Packages.com.novelgames.flashgames.MainSpookizDemo] Frame 0
class com.novelgames.flashgames.MainSpookizDemo extends MovieClip
{
var ascensseur, game, container, titleDepth;
function MainSpookizDemo () {
super();
}
static function initialize(movieClip) {
com.novelgames.flashgames.spookiz.Config.GAME_DEMO = true;
com.novelgames.flashgames.spookiz.Config.URL_REDIRECT = "http://uk.chapatiz.com";
_level0.langArray = new Array();
_level0.langArray.SPOOKIZ_START = "Start";
_level0.langArray.SPOOKIZ_SCORE = "High score";
_level0.langArray.SPOOKIZ_MOREGAMES = "More games";
_level0.langArray.SPOOKIZ_REPLAY = "Replay";
_level0.langArray.SPOOKIZ_HOME = "Home";
_level0.langArray.SPOOKIZ_HOWTOPLAY0 = "Move the monsters";
_level0.langArray.SPOOKIZ_HOWTOPLAY1 = "Descends more quickly";
_level0.langArray.SPOOKIZ_HOWTOPLAY2 = "Change their position";
movieClip.__proto__ = com.novelgames.flashgames.MainSpookizDemo.prototype;
movieClip.stop();
movieClip.ascensseur.init();
movieClip.gotoTitlePage();
movieClip.onEnterFrame = movieClip.checkTitle;
}
function gotoTitlePage() {
trace("Main.gotoTitlePage");
ascensseur.showAcceuil();
}
function gotoInstructionsPage() {
trace("Main.gotoInstructionsPage");
ascensseur.showInstruction();
}
function gotoGamePage() {
trace("Main.gotoGamePage");
ascensseur.open();
game = com.novelgames.flashgames.spookiz.Game(container.attachMovie("Game", "game", titleDepth));
}
function showHighScores() {
trace("showHighScores()");
}
function showEnterHighScore(score) {
showPlayAgain();
trace(("showEnterHighScore(" + score) + ")");
}
function showGameOver() {
removePage();
}
function showPlayAgain() {
removePage();
ascensseur.showGameOver();
}
function removePage() {
if (game) {
game.removeMovieClip();
}
}
}
Symbol 344 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) {
Debugger.trace("NewMovieClip.createMovie", {arg:arguments}, 1, true);
var _local5 = getNextHighestDepth();
var _local3;
if (createMovieCount == undefined) {
createMovieCount = 0;
}
if (name) {
_local3 = attachMovie(name, (name + "_") + createMovieCount, _local5);
} else {
_local3 = createEmptyMovieClip((name + "_") + createMovieCount, _local5);
_local3.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
_local3.addedToParent = false;
createMovieCount++;
return(_local3);
}
function createSound(name) {
return(new com.novelgames.flashgames.commonAS2.NewSound(this, name));
}
function toString() {
return("newMovieClip");
}
var addedToParent = false;
}
Symbol 345 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 346 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 347 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 348 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 349 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Event] Frame 0
class com.novelgames.flashgames.commonAS2.Event
{
function Event () {
}
static var ENTER_FRAME = "enterFrame";
}
Symbol 350 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.URLRequest] Frame 0
class com.novelgames.flashgames.commonAS2.URLRequest
{
var url;
function URLRequest (url) {
this.url = url;
}
}
Symbol 351 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 352 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 353 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Timer] Frame 0
interface com.novelgames.flashgames.commonAS2.Timer
{
}
Symbol 354 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 355 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 356 MovieClip [__Packages.com.novelgames.flashgames.spookiz.Game] Frame 0
class com.novelgames.flashgames.spookiz.Game extends com.novelgames.flashgames.commonAS2.CommonGame
{
var gameOverDialog, levelText, scoreText, nextBlocksHolder, columnsHolder, blocksHolder, downKeyIsDown, soundLand, createSound, soundSwitch, soundDestroy, soundLevelUp, soundGameOver, __score, __level, __get__stage, stage, column, blocks, intervalID, noOfCombos, removeMovieClip, columnSpeed, noOfDestroy, nextBlocks, lastMoveTime, _parent, destroyingBlocks, startDestroyTime, droppingBlocks, startDropTime, startGameOverTime, __get__parent;
function Game () {
super();
gameOverDialog.__proto__ = com.novelgames.flashgames.spookiz.GameOverDialog.prototype;
fireworksHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
levelText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
scoreText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
nextBlocksHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
columnsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
blocksHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
score = (0);
downKeyIsDown = false;
soundLand = createSound("SoundLand");
soundSwitch = createSound("SoundSwitch");
soundDestroy = createSound("SoundDestroy");
soundLevelUp = createSound("SoundLevelUp");
soundGameOver = createSound("SoundGameOver");
startFirstLevel();
}
function set score(score) {
__score = score;
scoreText.text = score.toString();
//return(this.score);
}
function get score() {
return(__score);
}
function set level(level) {
__level = level;
levelText.text = level.toString();
//return(this.level);
}
function get level() {
return(__level);
}
function unpause() {
super.unpause();
__get__stage().__set__focus(stage);
}
function getColumnCanMoveLeftRight(x) {
var _local3;
var _local2;
if (x < 0) {
return(false);
}
if (x >= com.novelgames.flashgames.spookiz.Config.DIMENSION_X) {
return(false);
}
_local3 = Math.ceil(column.__get__y() / com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
_local2 = 0;
while (_local2 < com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE) {
if (blocks[x][(com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE + _local3) + _local2] != null) {
return(false);
}
_local2++;
}
return(true);
}
function getColumnMaxEmptyY(x) {
var _local6 = Math.floor(x / com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
var _local5 = Math.ceil(x / com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
var _local4;
var _local3;
var _local2;
_local3 = com.novelgames.flashgames.spookiz.Config.DIMENSION_Y - 1;
while (_local3 >= 0) {
_local4 = true;
_local2 = _local6;
while (_local2 <= _local5) {
if (blocks[_local2][_local3 + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE] != null) {
_local4 = false;
break;
}
_local2++;
}
if (_local4) {
return(_local3);
}
_local3--;
}
return(_local3);
}
function finishedMovingColumn() {
var _local5;
var _local4;
var _local2;
var _local3;
_local3 = 0;
while (_local3 < com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE) {
_local2 = com.novelgames.flashgames.spookiz.Block(blocksHolder.attachMovie("Block", "Block_" + blocksHolder.getNextHighestDepth(), blocksHolder.getNextHighestDepth()));
_local2.initialize(column.blocks[_local3].id);
_local2.__set__x(column.indexX * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
_local2.__set__y((column.indexY + _local3) * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
_local2.indexX = column.indexX;
_local2.indexY = column.indexY + _local3;
blocksHolder.addChild(_local2);
blocks[column.indexX][(column.indexY + _local3) + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE] = _local2;
_local3++;
}
column.removeMovieClip();
com.novelgames.flashgames.commonAS2.Keyboard.addEventListener(com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN, this, "onMoveColumnKeyDown");
com.novelgames.flashgames.commonAS2.Keyboard.addEventListener(com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP, this, "onMoveColumnKeyUp");
intervalID.stop();
checkDestroy();
}
function startFirstLevel() {
setLevel(1);
noOfCombos = 0;
createBlocks();
createNextBlocks();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.spookiz.Config.INITIALWAITTIME, 1);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "startFirstColumn");
intervalID.start();
}
function startFirstColumn(timerEvent) {
startColumn();
}
function startLevel(level) {
setLevel(level);
noOfCombos = 0;
createBlocks();
createNextBlocks();
startColumn();
}
function setLevel(level) {
if (com.novelgames.flashgames.spookiz.Config.GAME_DEMO && (level > 4)) {
showPlayAgain();
checkGameOver(true);
removeMovieClip();
return(undefined);
}
this.level = (level);
columnSpeed = com.novelgames.flashgames.spookiz.Config.LEVEL_INITIALSPEED + ((level - 1) * com.novelgames.flashgames.spookiz.Config.LEVEL_SPEEDINCREASE);
noOfDestroy = 0;
}
function createBlocks() {
var _local3;
var _local2;
blocks = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.spookiz.Config.DIMENSION_X) {
blocks[_local3] = new Array();
_local2 = 0;
while (_local2 < (com.novelgames.flashgames.spookiz.Config.DIMENSION_Y + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE)) {
blocks[_local3][_local2] = null;
_local2++;
}
_local3++;
}
}
function createNextBlocks() {
var _local4;
var _local2;
var _local3;
nextBlocks = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE) {
_local2 = com.novelgames.flashgames.spookiz.Block(nextBlocksHolder.createMovie("Block"));
_local2.initialize(Math.floor(Math.random() * com.novelgames.flashgames.spookiz.Config.BLOCK_TYPES));
_local2.__set__y(_local3 * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
nextBlocksHolder.addChild(_local2);
nextBlocks.push(_local2);
_local3++;
}
}
function startColumn() {
createColumn(nextBlocks);
generateNextBlocks();
com.novelgames.flashgames.commonAS2.Keyboard.addEventListener(com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN, this, "onMoveColumnKeyDown");
com.novelgames.flashgames.commonAS2.Keyboard.addEventListener(com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP, this, "onMoveColumnKeyUp");
lastMoveTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onMoveColumnTime");
intervalID.start();
}
function createColumn(blocks) {
var _local4 = new Array();
var _local5;
var _local2;
_local2 = 0;
while (_local2 < blocks.length) {
_local4[_local2] = blocks[_local2].id;
_local2++;
}
column = com.novelgames.flashgames.spookiz.Column(columnsHolder.attachMovie("Column", "Column_" + columnsHolder.getNextHighestDepth(), columnsHolder.getNextHighestDepth()));
column.initialize(_local4);
column.indexX = Math.floor(com.novelgames.flashgames.spookiz.Config.DIMENSION_X / 2);
column.indexY = -com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE;
column.__set__x(column.indexX * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
column.__set__y(column.indexY * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
columnsHolder.addChild(column);
}
function generateNextBlocks() {
var _local2;
_local2 = 0;
while (_local2 < nextBlocks.length) {
nextBlocks[_local2].setID(Math.floor(Math.random() * com.novelgames.flashgames.spookiz.Config.BLOCK_TYPES));
_local2++;
}
}
function onMoveColumnKeyDown(keyboardEvent) {
switch (keyboardEvent.__get__keyCode()) {
case com.novelgames.flashgames.commonAS2.Keyboard.UP :
column.startRotate();
break;
case com.novelgames.flashgames.commonAS2.Keyboard.LEFT :
column.startMoveLeft();
_parent._parent.hamRoue.gotoAndStop("left");
break;
case com.novelgames.flashgames.commonAS2.Keyboard.RIGHT :
_parent._parent.hamRoue.gotoAndStop("right");
column.startMoveRight();
break;
case com.novelgames.flashgames.commonAS2.Keyboard.DOWN :
downKeyIsDown = true;
}
}
function onMoveColumnKeyUp(keyboardEvent) {
if (!(keyboardEvent.__get__keyCode() === com.novelgames.flashgames.commonAS2.Keyboard.DOWN)) {
} else {
downKeyIsDown = false;
}
_parent._parent.hamRoue.gotoAndStop("stopped");
}
function onMoveColumnTime(timerEvent) {
var _local2 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
column.rotate(_local2);
column.moveLeftRight(_local2);
if (downKeyIsDown) {
column.moveDown(_local2, (com.novelgames.flashgames.spookiz.Config.COLUMN_DROPSPEED * (_local2 - lastMoveTime)) / 1000);
} else {
column.moveDown(_local2, (columnSpeed * (_local2 - lastMoveTime)) / 1000);
}
lastMoveTime = _local2;
timerEvent.updateAfterEvent();
}
function checkDestroy() {
var _local7 = new Array();
var _local5;
var _local6;
var _local4;
var _local2;
var _local3;
_local4 = 0;
while (_local4 < com.novelgames.flashgames.spookiz.Config.DIMENSION_X) {
_local2 = 0;
while (_local2 < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_Y - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) + 1)) {
_local5 = getGroupSize(_local4, _local2, 0, 1);
if (_local5 >= com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) {
_local6 = new Array();
_local3 = 0;
while (_local3 < _local5) {
_local6.push(blocks[_local4][(_local2 + _local3) + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE]);
_local3++;
}
_local7.push(_local6);
}
_local2 = _local2 + _local5;
}
_local4++;
}
_local4 = 0;
while (_local4 < com.novelgames.flashgames.spookiz.Config.DIMENSION_Y) {
_local2 = 0;
while (_local2 < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_X - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) + 1)) {
_local5 = getGroupSize(_local2, _local4, 1, 0);
if (_local5 >= com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) {
_local6 = new Array();
_local3 = 0;
while (_local3 < _local5) {
_local6.push(blocks[_local2 + _local3][_local4 + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE]);
_local3++;
}
_local7.push(_local6);
}
_local2 = _local2 + _local5;
}
_local4++;
}
_local4 = (-com.novelgames.flashgames.spookiz.Config.DIMENSION_Y) + com.novelgames.flashgames.spookiz.Config.GROUP_SIZE;
while (_local4 < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_X - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) + 1)) {
_local2 = Math.max(-_local4, 0);
while (((_local4 + _local2) < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_X - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) + 1)) && (_local2 < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_Y - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) + 1))) {
_local5 = getGroupSize(_local4 + _local2, _local2, 1, 1);
if (_local5 >= com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) {
_local6 = new Array();
_local3 = 0;
while (_local3 < _local5) {
_local6.push(blocks[(_local4 + _local2) + _local3][(_local2 + _local3) + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE]);
_local3++;
}
_local7.push(_local6);
}
_local2 = _local2 + _local5;
}
_local4++;
}
_local4 = com.novelgames.flashgames.spookiz.Config.GROUP_SIZE - 1;
while (_local4 < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_X + com.novelgames.flashgames.spookiz.Config.DIMENSION_Y) - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE)) {
_local2 = Math.max((_local4 - com.novelgames.flashgames.spookiz.Config.DIMENSION_X) + 1, 0);
while (((_local4 - _local2) >= (com.novelgames.flashgames.spookiz.Config.GROUP_SIZE - 1)) && (_local2 < ((com.novelgames.flashgames.spookiz.Config.DIMENSION_Y - com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) + 1))) {
_local5 = getGroupSize(_local4 - _local2, _local2, -1, 1);
if (_local5 >= com.novelgames.flashgames.spookiz.Config.GROUP_SIZE) {
_local6 = new Array();
_local3 = 0;
while (_local3 < _local5) {
_local6.push(blocks[(_local4 - _local2) - _local3][(_local2 + _local3) + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE]);
_local3++;
}
_local7.push(_local6);
}
_local2 = _local2 + _local5;
}
_local4++;
}
if (_local7.length > 0) {
destroyGroups(_local7);
} else if (!checkGameOver()) {
noOfCombos = 0;
startColumn();
}
}
function getGroupSize(x, y, stepX, stepY) {
var _local5;
var _local4;
if (blocks[x][y + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE] == null) {
return(1);
}
_local5 = blocks[x][y + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE].id;
_local4 = 1;
x = x + stepX;
y = y + stepY;
while ((((x >= 0) && (x < com.novelgames.flashgames.spookiz.Config.DIMENSION_X)) && (y >= 0)) && (y < com.novelgames.flashgames.spookiz.Config.DIMENSION_Y)) {
if ((!blocks[x][y + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE]) || (blocks[x][y + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE].id != _local5)) {
return(_local4);
}
_local4++;
x = x + stepX;
y = y + stepY;
}
return(_local4);
}
function destroyGroups(groups) {
var _local5 = 0;
var _local3;
var _local2;
destroyingBlocks = new Array();
_local3 = 0;
while (_local3 < groups.length) {
_local2 = 0;
while (_local2 < groups[_local3].length) {
blocks[groups[_local3][_local2].indexX][groups[_local3][_local2].indexY + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE].block.gotoAndStop(2);
blocks[groups[_local3][_local2].indexX][groups[_local3][_local2].indexY + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE].block.explosion.play();
blocks[groups[_local3][_local2].indexX][groups[_local3][_local2].indexY + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE] = null;
destroyingBlocks.push(groups[_local3][_local2]);
_local2++;
}
_local5 = _local5 + (((com.novelgames.flashgames.spookiz.Config.SCORE_GROUP + ((groups[_local3].length - com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE) * com.novelgames.flashgames.spookiz.Config.SCORE_EXTRABLOCK)) + ((groups.length - 1) * com.novelgames.flashgames.spookiz.Config.SCORE_EXTRAGROUP)) + (noOfCombos * com.novelgames.flashgames.spookiz.Config.SCORE_COMBO));
_local3++;
}
score = score + _local5;
noOfDestroy++;
if (noOfDestroy >= com.novelgames.flashgames.spookiz.Config.LEVEL_NOOFFIREWORKS) {
setLevel(level + 1);
soundLevelUp.play();
}
noOfCombos++;
soundDestroy.play();
startDestroyTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onDestroyBlocksTime");
intervalID.start();
}
function onDestroyBlocksTime(timerEvent) {
var _local5 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local4 = (_local5 - startDestroyTime) / com.novelgames.flashgames.spookiz.Config.BLOCK_DESTROYTIME;
var _local3;
var _local2;
if (_local4 > 1) {
_local4 = 1;
}
_local3 = 1 - _local4;
_local2 = 0;
while (_local2 < destroyingBlocks.length) {
destroyingBlocks[_local2].alpha = _local3;
_local2++;
}
if (_local4 == 1) {
_local2 = 0;
while (_local2 < destroyingBlocks.length) {
if (destroyingBlocks[_local2].parent == null) {
} else {
blocksHolder.removeChild(destroyingBlocks[_local2]);
}
_local2++;
}
intervalID.stop();
dropBlocks();
}
timerEvent.updateAfterEvent();
}
function dropBlocks() {
var _local4;
var _local3;
var _local2;
droppingBlocks = new Array();
_local3 = 0;
while (_local3 < blocks.length) {
_local4 = 0;
_local2 = blocks[_local3].length - 1;
while (_local2 >= 0) {
if (blocks[_local3][_local2] == null) {
_local4++;
} else if (_local4 > 0) {
blocks[_local3][_local2].targetY = blocks[_local3][_local2].indexY + _local4;
droppingBlocks.push(blocks[_local3][_local2]);
blocks[_local3][_local2] = null;
}
_local2--;
}
_local3++;
}
startDropTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onDropBlocksTime");
intervalID.start();
}
function onDropBlocksTime(timerEvent) {
var _local4 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local3 = ((com.novelgames.flashgames.spookiz.Config.BLOCK_DROPACCELERATION * (_local4 - startDropTime)) * (_local4 - startDropTime)) / 2000000;
var _local2;
_local2 = 0;
while (_local2 < droppingBlocks.length) {
if (_local3 < ((droppingBlocks[_local2].targetY - droppingBlocks[_local2].indexY) * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE)) {
droppingBlocks[_local2].y = (droppingBlocks[_local2].indexY * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE) + _local3;
} else {
droppingBlocks[_local2].y = droppingBlocks[_local2].targetY * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE;
droppingBlocks[_local2].indexY = droppingBlocks[_local2].targetY;
blocks[droppingBlocks[_local2].indexX][droppingBlocks[_local2].indexY + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE] = droppingBlocks[_local2];
droppingBlocks.splice(_local2, 1);
_local2--;
}
_local2++;
}
if (droppingBlocks.length == 0) {
intervalID.stop();
checkDestroy();
}
timerEvent.updateAfterEvent();
}
function checkGameOver(forcing) {
var _local2;
if (!forcing) {
_local2 = 0;
while (_local2 < com.novelgames.flashgames.spookiz.Config.DIMENSION_X) {
if (blocks[_local2][com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE - 1] != null) {
break;
}
_local2++;
}
if (_local2 >= com.novelgames.flashgames.spookiz.Config.DIMENSION_X) {
return(false);
}
}
soundGameOver.play();
startGameOverTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onGameOverTime");
intervalID.start();
return(true);
}
function onGameOverTime(timerEvent) {
var _local7 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local6;
var _local4;
var _local2;
var _local5;
var _local3;
_local5 = 0;
while (_local5 < com.novelgames.flashgames.spookiz.Config.DIMENSION_Y) {
_local6 = startGameOverTime + (_local5 * com.novelgames.flashgames.spookiz.Config.GAMEOVER_DISAPPEARROWINTERVAL);
if (_local7 < _local6) {
} else {
_local4 = 1 - ((_local7 - _local6) / com.novelgames.flashgames.spookiz.Config.GAMEOVER_DISAPPEARTIME);
if (_local4 < 0) {
_local4 = 0;
}
_local3 = 0;
while (_local3 < com.novelgames.flashgames.spookiz.Config.DIMENSION_X) {
_local2 = blocks[_local3][_local5 + com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE];
if (!_local2) {
} else {
_local2.__set__scaleX(_local4);
_local2.__set__scaleY(_local4);
_local2.__set__x((_local2.indexX * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE) + ((com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE - _local2.__get__width()) / 2));
_local2.__set__y((_local2.indexY * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE) + ((com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE - _local2.__get__height()) / 2));
}
_local3++;
}
}
_local5++;
}
if (_local7 > ((startGameOverTime + ((com.novelgames.flashgames.spookiz.Config.DIMENSION_Y - 1) * com.novelgames.flashgames.spookiz.Config.GAMEOVER_DISAPPEARROWINTERVAL)) + com.novelgames.flashgames.spookiz.Config.GAMEOVER_DISAPPEARTIME)) {
intervalID.stop();
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.spookiz.Config.MESSAGE_GAMEOVERTIME, 1);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "showPlayAgain");
intervalID.start();
}
timerEvent.updateAfterEvent();
}
function showPlayAgain(timerEvent) {
Object(__get__parent())._parent.showEnterHighScore(score);
}
}
Symbol 357 MovieClip [__Packages.com.novelgames.flashgames.spookiz.GameOverDialog] Frame 0
class com.novelgames.flashgames.spookiz.GameOverDialog extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var stop, gotoAndStop, messagePlayAgain, createMovie, addChild, __get__parent;
function GameOverDialog () {
super();
(stop());// not popped
}
function show() {
(gotoAndStop("show"));// not popped
}
function showPlayAgain() {
(gotoAndStop("hide"));// not popped
messagePlayAgain = com.novelgames.flashgames.spookiz.MessagePlayAgain(createMovie("MessagePlayAgain"));
messagePlayAgain.playAgainButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "playAgainButtonClicked");
messagePlayAgain.homeButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "homeButtonClicked");
addChild(messagePlayAgain);
}
function playAgainButtonClicked(mouseEvent) {
Object(__get__parent().parent).gotoGamePage();
}
function homeButtonClicked(mouseEvent) {
Object(__get__parent().parent).gotoTitlePage();
}
}
Symbol 358 MovieClip [__Packages.com.novelgames.flashgames.spookiz.MessagePlayAgain] Frame 0
class com.novelgames.flashgames.spookiz.MessagePlayAgain extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var playAgainButton, homeButton;
function MessagePlayAgain () {
super();
playAgainButton.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
homeButton.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
}
Symbol 359 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 360 MovieClip [__Packages.com.novelgames.flashgames.spookiz.Column] Frame 0
class com.novelgames.flashgames.spookiz.Column extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var blocks, createMovie, addChild, rotating, _parent, rotateTime, movingLeft, movingRight, moveTime, indexX, __set__x, __get__y, __get__x, y, indexY, stopping, __set__y, stopTime;
function Column () {
super();
}
function initialize(ids) {
var _local6;
var _local3;
var _local2;
var _local4;
blocks = new Array();
_local4 = 0;
while (_local4 <= com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE) {
_local3 = com.novelgames.flashgames.spookiz.Block(createMovie("Block"));
_local3.initialize(ids[_local4 % ids.length]);
_local3.__set__y(com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE * (_local4 % com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE));
addChild(_local3);
_local2 = com.novelgames.flashgames.commonAS2.NewMovieClip(createMovie());
_local2.graphics.beginFill(0);
_local2.graphics.moveTo(0, 0);
_local2.graphics.lineTo(com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE, 0);
_local2.graphics.lineTo(com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE, com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE * com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE);
_local2.graphics.lineTo(0, com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE * com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE);
_local2.graphics.lineTo(0, 0);
_local2.graphics.endFill();
addChild(_local2);
_local3.__set__mask(_local2);
blocks.push(_local3);
_local4++;
}
rotating = false;
}
function startRotate() {
if (rotating) {
return(undefined);
}
rotating = true;
_parent._parent.soundSwitch.play();
rotateTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
}
function startMoveLeft() {
if (movingLeft) {
return(undefined);
}
movingLeft = true;
movingRight = false;
moveTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
}
function startMoveRight() {
if (movingRight) {
return(undefined);
}
movingLeft = false;
movingRight = true;
moveTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
}
function rotate(time) {
var _local3;
var _local2;
if (!rotating) {
return(undefined);
}
_local3 = (time - rotateTime) / com.novelgames.flashgames.spookiz.Config.COLUMN_ROTATETIME;
if (_local3 > 1) {
_local3 = 1;
}
_local2 = 0;
while (_local2 < blocks.length) {
blocks[_local2].y = (_local2 * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE) - (_local3 * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
_local2++;
}
if (_local3 >= 1) {
_local2 = 0;
while (_local2 < blocks.length) {
blocks[_local2].setID(blocks[(_local2 + 1) % blocks.length].id);
blocks[_local2].y = _local2 * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE;
_local2++;
}
rotating = false;
}
}
function moveLeftRight(time) {
var _local2;
var _local4;
if ((!movingLeft) && (!movingRight)) {
return(undefined);
}
if (movingLeft) {
if (!_parent._parent.getColumnCanMoveLeftRight(indexX - 1)) {
movingLeft = false;
return(undefined);
}
} else if (movingRight) {
if (!_parent._parent.getColumnCanMoveLeftRight(indexX + 1)) {
movingRight = false;
return(undefined);
}
}
_local2 = (time - moveTime) / com.novelgames.flashgames.spookiz.Config.COLUMN_MOVETIME;
if (_local2 > 1) {
_local2 = 1;
}
__set__x((indexX * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE) + (((movingLeft ? -1 : 1) * _local2) * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE));
if (_local2 >= 1) {
indexX = indexX + (movingLeft ? -1 : 1);
movingLeft = false;
movingRight = false;
}
}
function moveDown(time, distance) {
var _local4 = ((__get__y() + ((com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE - 1) * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE)) + distance) / com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE;
var _local3 = _parent._parent.getColumnMaxEmptyY(__get__x());
var _local2 = new Object();
if (_local3 > _local4) {
_local2["maxY>bottomY"] = true;
y = y + distance;
indexY = Math.floor(__get__y() / com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
stopping = false;
} else {
indexY = _local3 - (com.novelgames.flashgames.spookiz.Config.COLUMN_SIZE - 1);
__set__y(indexY * com.novelgames.flashgames.spookiz.Config.BLOCK_SIZE);
_local2["maxY>bottomY"] = false;
if (!stopping) {
_local2.stopping = false;
stopping = true;
stopTime = time;
_parent._parent.soundLand.play();
} else {
_local2.stopping = true;
if ((time - stopTime) >= com.novelgames.flashgames.spookiz.Config.COLUMN_MAXSTOPTIME) {
if ((!movingLeft) && (!movingRight)) {
_parent._parent.finishedMovingColumn();
}
}
}
return(undefined);
}
}
}
Symbol 361 MovieClip [__Packages.com.novelgames.flashgames.spookiz.Block] Frame 0
class com.novelgames.flashgames.spookiz.Block extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var stop, cacheAsBitmap, id, gotoAndStop, intervalID, block;
function Block () {
super();
stop();
}
function initialize(id) {
setID(id);
cacheAsBitmap = true;
}
function setID(id) {
this.id = id;
(gotoAndStop(id + 1));// not popped
intervalID = new com.novelgames.flashgames.commonAS2.NewTimer(Math.round(Math.random() * 14000) + 1000);
intervalID.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "playAnim");
intervalID.start();
}
function playAnim() {
block.anim.gotoAndPlay(1);
}
}
Symbol 362 MovieClip [__Packages.com.novelgames.flashgames.spookiz.Config] Frame 0
class com.novelgames.flashgames.spookiz.Config
{
function Config () {
}
static var DIMENSION_X = 6;
static var DIMENSION_Y = 13;
static var INITIALWAITTIME = 1000;
static var BLOCK_TYPES = 6;
static var BLOCK_SIZE = 30;
static var BLOCK_DESTROYTIME = 200;
static var BLOCK_DROPACCELERATION = 1000;
static var COLUMN_SIZE = 3;
static var COLUMN_MOVETIME = 100;
static var COLUMN_ROTATETIME = 100;
static var COLUMN_DROPSPEED = 1000;
static var COLUMN_MAXSTOPTIME = 200;
static var GROUP_SIZE = 3;
static var FIREWORK_HEIGHT = 200;
static var FIREWORK_EXPLODERADIUS = 100;
static var FIREWORK_RISEDOTRADIUS = 5;
static var FIREWORK_RISEDOTCOLOUR = 16777215;
static var FIREWORK_EXPLODEDOTRADIUS = 3;
static var FIREWORK_EXPLODECOLOURS = [16711680, 65280, 255, 16776960, 65535, 16711935, 16777215];
static var FIREWORK_EXPLODEDOTNUMBER = 100;
static var FIREWORK_RISETIME = 1000;
static var FIREWORK_EXPLODETIME = 500;
static var FIREWORK_STARTDISAPPEARTIME = 400;
static var FIREWORK_SCOREHEIGHT = 70;
static var SCORE_GROUP = 200;
static var SCORE_EXTRABLOCK = 100;
static var SCORE_EXTRAGROUP = 200;
static var SCORE_COMBO = 100;
static var LEVEL_INITIALSPEED = 20;
static var LEVEL_SPEEDINCREASE = 10;
static var LEVEL_NOOFFIREWORKS = 10;
static var GAMEOVER_DISAPPEARTIME = 300;
static var GAMEOVER_DISAPPEARROWINTERVAL = 100;
static var MESSAGE_GAMEOVERTIME = 1000;
static var GAME_DEMO = false;
static var URL_REDIRECT = "http://www.chapatiz.com";
}
Symbol 363 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Keyboard] Frame 0
class com.novelgames.flashgames.commonAS2.Keyboard
{
static var listenerArray;
function Keyboard () {
}
static function addEventListener(type, listenerObject, listenerFunctionName) {
if (listenerArray == undefined) {
listenerArray = new Array();
Key.addListener({onKeyDown:chapatiz.utils.Delegate.create(com.novelgames.flashgames.commonAS2.Keyboard, onKeyMove, com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN), onKeyUp:chapatiz.utils.Delegate.create(com.novelgames.flashgames.commonAS2.Keyboard, onKeyMove, com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP)});
}
if (listenerArray[type] == undefined) {
listenerArray[type] = new Array();
}
listenerArray[type].push({target:listenerObject, func:listenerObject[listenerFunctionName]});
}
static function removeEventListener(type, listenerObject, listenerFunctionName) {
if (listenerArray[type] == undefined) {
return(undefined);
}
for (var _local3 in listenerArray[type]) {
if (listenerArray[type][_local3].func == listenerObject[listenerFunctionName]) {
delete listenerArray[type][_local3];
}
}
}
static function onKeyMove(type) {
if (listenerArray[type] == undefined) {
return(undefined);
}
for (var _local2 in listenerArray[type]) {
listenerArray[type][_local2].func.apply(listenerArray[type][_local2].target, [new com.novelgames.flashgames.commonAS2.KeyboardEvent(com.novelgames.flashgames.commonAS2.Keyboard)]);
}
}
static var LEFT = 37;
static var RIGHT = 39;
static var UP = 38;
static var DOWN = 40;
static var SPACE = 32;
static var BACKSPACE = 8;
static var SHIFT = 16;
static var ENTER = 13;
}
Symbol 364 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 365 MovieClip [__Packages.com.novelgames.flashgames.spookiz.Ascensseur] Frame 0
class com.novelgames.flashgames.spookiz.Ascensseur extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var gotoAndStop, _isClose, gotoAndPlay, menu, getURL;
function Ascensseur () {
super();
}
function init() {
trace("Ascensseur.init");
gotoAndStop("init");
_isClose = false;
}
function open() {
if (!_isClose) {
return(undefined);
}
trace("Ascensseur.open");
trace(this);
gotoAndPlay("open");
_isClose = false;
}
function close() {
if (_isClose) {
return(undefined);
}
trace("Ascensseur.close");
gotoAndPlay("close");
_isClose = true;
}
function showAcceuil() {
close();
trace("Ascensseur.showAcceuil");
menu.gotoAndStop("start");
menu.startButton.onRelease = chapatiz.utils.Delegate.create(this, showInstruction);
menu.scoreButton.onRelease = chapatiz.utils.Delegate.create(this, showScore);
menu.moreGamesButton.onRelease = chapatiz.utils.Delegate.create(this, showGames);
trace((chapatiz.utils.Localisation.localString("SPOOKIZ_START") + " ") + chapatiz.utils.Localisation.localString("SPOOKIZ_SCORE"));
menu.startButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_START");
menu.scoreButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_SCORE");
menu.moreGamesButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_MOREGAMES");
}
function showInstruction() {
close();
trace("Ascensseur.showInstruction");
menu.gotoAndStop("instruction");
menu.startButton.onRelease = function () {
this._parent._parent._parent.gotoGamePage();
};
menu.startButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_START");
menu.howToPlay0.text = chapatiz.utils.Localisation.localString("SPOOKIZ_HOWTOPLAY0");
menu.howToPlay1.text = chapatiz.utils.Localisation.localString("SPOOKIZ_HOWTOPLAY1");
menu.howToPlay2.text = chapatiz.utils.Localisation.localString("SPOOKIZ_HOWTOPLAY2");
}
function showGameOver() {
trace("Ascensseur.showGameOver");
close();
menu.gotoAndStop("gameover");
menu.replayButton.onRelease = function () {
this._parent._parent._parent.gotoGamePage();
};
menu.homeButton.onRelease = chapatiz.utils.Delegate.create(this, showAcceuil);
menu.chapaButton.onRelease = chapatiz.utils.Delegate.create(this, showGames);
menu.replayButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_REPLAY");
menu.homeButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_HOME");
menu.chapaButton.label.text = chapatiz.utils.Localisation.localString("SPOOKIZ_MOREGAMES");
}
function showScore() {
getURL(com.novelgames.flashgames.spookiz.Config.URL_REDIRECT + "/games/spookiz", "_blank");
}
function showGames() {
getURL(com.novelgames.flashgames.spookiz.Config.URL_REDIRECT + "/games", "_blank");
}
}
Symbol 366 MovieClip [__Packages.chapatiz.utils.Localisation] Frame 0
class chapatiz.utils.Localisation
{
function Localisation () {
}
static function localString(strKey, defaultStr) {
if (((strKey == undefined) || (_level0.langArray == undefined)) || (_level0.langArray[strKey] == undefined)) {
return(((defaultStr != undefined) ? (defaultStr) : ""));
}
trace(_level0.langArray[strKey]);
return(_level0.langArray[strKey]);
}
}
Symbol 367 MovieClip [__Packages.chapatiz.rooms.kashgame.Kashgame] Frame 0
class chapatiz.rooms.kashgame.Kashgame
{
var _room, _decor, _collclip, _gameId, score;
function Kashgame (room, gameId) {
_room = room;
_decor = room.decor;
_collclip = room.collclip;
_gameId = gameId;
_level2.kashgameWindow.gameId = gameId;
}
function endGame(s) {
score = s;
_level0.server.send(("<endgame s=\"" + s) + "\"/>");
}
function onCustomMessage(type, _xml) {
var _local3 = new Array();
for (var _local4 in _xml.attributes) {
_local3[_local4] = _xml.attributes[_local4];
}
if (score >= 0) {
_local3.score = score;
}
_level2.kashgameWindow.open(type, _local3);
}
}
Symbol 368 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 369 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Title] Frame 0
class com.novelgames.flashgames.commonAS2.Title extends MovieClip
{
var startButton, highScoresButton, moreGamesButton, _parent, getURL;
function Title () {
super();
startButton.onRelease = function () {
this._parent.startButtonClicked();
};
highScoresButton.onRelease = function () {
this._parent.highScoresButtonClicked();
};
moreGamesButton.onRelease = function () {
this._parent.moreGamesButtonClicked();
};
}
function startButtonClicked() {
_parent.gotoInstructionsPage();
}
function highScoresButtonClicked() {
(getURL("http://uk.chapatiz.com/games/blobipop/", "_blank"));// not popped
}
function moreGamesButtonClicked() {
(getURL("http://uk.chapatiz.com/games", "_blank"));// not popped
}
function infoButtonClicked() {
(getURL("http://uk.chapatiz.com/cms/", "_blank"));// not popped
}
}
Symbol 370 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();
};
}
}