Frame 1
function checkLoad() {
var _local1 = getBytesLoaded();
var _local2 = _local1 / totalBytes;
loadPercent_txt.text = Math.floor(_local2 * 100) + "%";
if (_local1 == totalBytes) {
gotoAndStop ("title");
clearInterval(nCheck);
}
}
stop();
var nCheck = setInterval(checkLoad, 20);
var totalBytes = getBytesTotal();
Frame 2
com.novelgames.flashgames.common.MainDevelopment.initialize(this);
Symbol 19 MovieClip [snowman] Frame 1
#initclip 19
Object.registerClass("snowman", com.novelgames.flashgames.snowman.Snowman);
#endinitclip
Symbol 68 MovieClip [snowmanSki] Frame 1
#initclip 12
Object.registerClass("snowmanSki", com.novelgames.flashgames.snowman.SnowmanSki);
#endinitclip
Symbol 80 MovieClip [thing] Frame 1
#initclip 13
Object.registerClass("thing", com.novelgames.flashgames.snowman.Thing);
#endinitclip
Symbol 130 MovieClip [dialog] Frame 1
#initclip 14
Object.registerClass("dialog", com.novelgames.flashgames.snowman.Dialog);
#endinitclip
Symbol 130 MovieClip [dialog] Frame 35
completeFinished();
Symbol 130 MovieClip [dialog] Frame 55
gameOverFinished();
Symbol 134 MovieClip [muteButton] Frame 1
#initclip 15
Object.registerClass("muteButton", com.novelgames.flashgames.common.MuteButton);
#endinitclip
Symbol 135 MovieClip [thingsHolder] Frame 1
#initclip 16
Object.registerClass("thingsHolder", com.novelgames.flashgames.snowman.ThingsHolder);
#endinitclip
Symbol 136 MovieClip [ground] Frame 1
#initclip 17
Object.registerClass("ground", com.novelgames.flashgames.snowman.Ground);
#endinitclip
Symbol 161 MovieClip [game] Frame 1
#initclip 18
Object.registerClass("game", com.novelgames.flashgames.snowman.Game);
#endinitclip
Symbol 181 MovieClip [__Packages.com.novelgames.flashgames.snowman.SnowmanSki] Frame 0
class com.novelgames.flashgames.snowman.SnowmanSki extends MovieClip
{
var angle, directionX, directionY, scale, completed, destroyed, ski, _parent, snowman;
function SnowmanSki () {
super();
angle = 0;
directionX = 0;
directionY = 1;
scale = 97;
completed = false;
destroyed = false;
}
function turn(turnAngle) {
setAngle(angle + turnAngle);
}
function setAngle(theAngle) {
angle = theAngle;
if (angle < com.novelgames.flashgames.snowman.Config.SNOWMAN_MINANGLE) {
angle = com.novelgames.flashgames.snowman.Config.SNOWMAN_MINANGLE;
} else if (angle > com.novelgames.flashgames.snowman.Config.SNOWMAN_MAXANGLE) {
angle = com.novelgames.flashgames.snowman.Config.SNOWMAN_MAXANGLE;
}
directionX = -Math.sin((angle * Math.PI) / 180);
directionY = Math.cos((angle * Math.PI) / 180);
ski._rotation = angle;
}
function hitThing(thing) {
switch (thing.type) {
case com.novelgames.flashgames.snowman.Thing.TYPE_SNOW :
_parent._parent.snowmanHitSnow();
changeScale(com.novelgames.flashgames.snowman.Config.SNOWMAN_SCALECHANGE);
break;
case com.novelgames.flashgames.snowman.Thing.TYPE_PINE :
case com.novelgames.flashgames.snowman.Thing.TYPE_BRANCH :
case com.novelgames.flashgames.snowman.Thing.TYPE_CARROT :
_parent._parent.snowmanHitThing();
if (snowman.addThing(thing.type)) {
if (!completed) {
completed = true;
_parent._parent.snowmanCompleted();
}
}
break;
case com.novelgames.flashgames.snowman.Thing.TYPE_TREE :
_parent._parent.snowmanHitTree();
changeScale(-com.novelgames.flashgames.snowman.Config.SNOWMAN_SCALECHANGE);
}
}
function changeScale(changeAmount) {
scale = scale + changeAmount;
if (scale < com.novelgames.flashgames.snowman.Config.SNOWMAN_SCALEMIN) {
snowman._visible = true;
_parent._parent.snowmanDestroyed();
return(undefined);
}
if (scale > com.novelgames.flashgames.snowman.Config.SNOWMAN_SCALEMAX) {
scale = com.novelgames.flashgames.snowman.Config.SNOWMAN_SCALEMAX;
}
snowman._xscale = scale;
snowman._yscale = scale;
snowman.clearThings();
completed = false;
}
}
Symbol 182 MovieClip [__Packages.com.novelgames.flashgames.snowman.Snowman] Frame 0
class com.novelgames.flashgames.snowman.Snowman extends MovieClip
{
var hasLeftEye, leftEye, hasRightEye, rightEye, hasLeftArm, leftArm, hasRightArm, rightArm, hasNose, nose;
function Snowman () {
super();
clearThings();
}
function addThing(type) {
switch (type) {
case com.novelgames.flashgames.snowman.Thing.TYPE_PINE :
if (!hasLeftEye) {
hasLeftEye = true;
leftEye._visible = true;
} else if (!hasRightEye) {
hasRightEye = true;
rightEye._visible = true;
}
break;
case com.novelgames.flashgames.snowman.Thing.TYPE_BRANCH :
if (!hasLeftArm) {
hasLeftArm = true;
leftArm._visible = true;
} else if (!hasRightArm) {
hasRightArm = true;
rightArm._visible = true;
}
break;
case com.novelgames.flashgames.snowman.Thing.TYPE_CARROT :
if (hasNose) {
break;
}
hasNose = true;
nose._visible = true;
}
return((((hasLeftEye && (hasRightEye)) && (hasLeftArm)) && (hasRightArm)) && (hasNose));
}
function clearThings() {
hasLeftEye = false;
hasRightEye = false;
hasLeftArm = false;
hasRightArm = false;
hasNose = false;
leftEye._visible = false;
rightEye._visible = false;
leftArm._visible = false;
rightArm._visible = false;
nose._visible = false;
}
}
Symbol 183 MovieClip [__Packages.com.novelgames.flashgames.snowman.Thing] Frame 0
class com.novelgames.flashgames.snowman.Thing extends MovieClip
{
var stop, type, x, y, gotoAndStop, isBeforeSnowman, cacheAsBitmap;
function Thing () {
super();
stop();
}
function initialize(type, x, y) {
this.type = type;
this.x = x;
this.y = y;
switch (type) {
case TYPE_SNOW :
gotoAndStop("snow");
break;
case TYPE_PINE :
gotoAndStop("pine");
break;
case TYPE_BRANCH :
gotoAndStop("branch");
break;
case TYPE_CARROT :
gotoAndStop("carrot");
break;
case TYPE_TREE :
gotoAndStop("tree");
}
isBeforeSnowman = true;
cacheAsBitmap = true;
}
function addSnow() {
if (type == TYPE_TREE) {
gotoAndStop("treeSnow");
}
}
static var TYPE_SNOW = 1;
static var TYPE_PINE = 2;
static var TYPE_BRANCH = 3;
static var TYPE_CARROT = 3;
static var TYPE_TREE = 5;
}
Symbol 184 MovieClip [__Packages.com.novelgames.flashgames.snowman.Config] Frame 0
class com.novelgames.flashgames.snowman.Config
{
function Config () {
}
static var SNOWMAN_STARTX = 300;
static var SNOWMAN_STARTY = 110;
static var SNOWMAN_MINX = 50;
static var SNOWMAN_MAXX = 680;
static var SNOWMAN_TURNSPEED = 360;
static var SNOWMAN_MINANGLE = -60;
static var SNOWMAN_MAXANGLE = 60;
static var SNOWMAN_ACCELERATION = 200;
static var SNOWMAN_INITIALMAXSPEED = 400;
static var SNOWMAN_MAXSPEEDINCREASE = 50;
static var SNOWMAN_SCALECHANGE = 1;
static var SNOWMAN_SCALEMIN = 96;
static var SNOWMAN_SCALEMAX = 100;
static var SNOWMAN_CLEARSPEEDDECREASE = 80;
static var THING_MINSPACING = 300;
static var THING_MAXSPACING = 400;
static var THING_MINX = 50;
static var THING_MAXX = 550;
static var THING_MAXHEIGHT = 160;
static var THING_WEIGHTPINE = 3;
static var THING_WEIGHTBRANCH = 3;
static var THING_WEIGHTCARROT = 3;
static var THING_WEIGHTTREE = 3;
static var GROUND_SHADELEFTMINX = -100;
static var GROUND_SHADELEFTMAXX = 0;
static var GROUND_SHADERIGHTMINX = 350;
static var GROUND_SHADERIGHTMAXX = 500;
static var GROUND_SHADEMINSPACING = 400;
static var GROUND_SHADEMAXSPACING = 800;
static var SCORE_THING = 50;
static var SCORE_SNOWMAN = 3000;
static var SCORE_TIMEBASE = 2000;
static var SCORE_TIME = 50;
}
Symbol 185 MovieClip [__Packages.com.novelgames.flashgames.snowman.Dialog] Frame 0
class com.novelgames.flashgames.snowman.Dialog extends MovieClip
{
var stop, gotoAndPlay, time, gotoAndStop, playAgainButton, _parent;
function Dialog () {
super();
stop();
}
function showComplete(time) {
gotoAndPlay("complete");
this.time = time;
}
function showGameOver() {
gotoAndPlay("gameOver");
}
function hide() {
gotoAndStop("hide");
}
function completeFinished() {
gotoAndStop("hide");
}
function gameOverFinished() {
stop();
playAgainButton.onRelease = function () {
this._parent._parent._parent.gotoTitlePage();
};
_parent.showEnterHighScore();
}
}
Symbol 186 MovieClip [__Packages.com.novelgames.flashgames.common.MuteButton] Frame 0
class com.novelgames.flashgames.common.MuteButton extends MovieClip
{
var gotoAndStop;
function MuteButton () {
super();
if (com.novelgames.flashgames.common.NewSound.getIsMuteAll()) {
showOff();
} else {
showOn();
}
}
function onPress() {
if (com.novelgames.flashgames.common.NewSound.getIsMuteAll()) {
com.novelgames.flashgames.common.NewSound.unmuteAll();
showOn();
} else {
com.novelgames.flashgames.common.NewSound.muteAll();
showOff();
}
}
function showOff() {
gotoAndStop("off");
}
function showOn() {
gotoAndStop("on");
}
}
Symbol 187 MovieClip [__Packages.com.novelgames.flashgames.common.NewSound] Frame 0
class com.novelgames.flashgames.common.NewSound extends Sound
{
var attachSound, setVolume, target, symbolName;
function NewSound (target, symbolName) {
super(target);
var _local3;
attachSound(symbolName);
setVolume(volumeAll);
this.target = target;
this.symbolName = symbolName;
sounds.push(this);
_local3 = 0;
while (_local3 < sounds.length) {
if (sounds[_local3] == this) {
} else if ((sounds[_local3].target == target) && (sounds[_local3].symbolName == symbolName)) {
sounds.splice(_local3, 1);
_local3--;
}
_local3++;
}
}
static function setVolumeAll(volume) {
var _local1;
volumeAll = volume;
_local1 = 0;
while (_local1 < sounds.length) {
sounds[_local1].setVolume(volume);
_local1++;
}
}
static function muteAll() {
setVolumeAll(0);
}
static function unmuteAll() {
setVolumeAll(100);
}
static function getIsMuteAll() {
return(volumeAll == 0);
}
static var sounds = new Array();
static var volumeAll = 100;
}
Symbol 188 MovieClip [__Packages.com.novelgames.flashgames.snowman.ThingsHolder] Frame 0
class com.novelgames.flashgames.snowman.ThingsHolder extends MovieClip
{
var getNextHighestDepth, attachMovie, snowman, thingY, things, possibleThingTypes, y;
function ThingsHolder () {
super();
}
function initialize() {
var _local5 = getNextHighestDepth();
var _local3 = attachMovie("snowmanSki", "snowman", 0);
var _local4;
var _local2;
snowman = _local3;
_local4 = snowman.getBounds(snowman);
snowman._x = com.novelgames.flashgames.snowman.Config.SNOWMAN_STARTX;
snowman._y = com.novelgames.flashgames.snowman.Config.SNOWMAN_STARTY;
thingY = com.novelgames.flashgames.snowman.Config.THING_MAXSPACING;
things = new Array();
possibleThingTypes = new Array();
_local2 = 0;
while (_local2 < com.novelgames.flashgames.snowman.Config.THING_WEIGHTPINE) {
possibleThingTypes.push(com.novelgames.flashgames.snowman.Thing.TYPE_PINE);
_local2++;
}
_local2 = 0;
while (_local2 < com.novelgames.flashgames.snowman.Config.THING_WEIGHTBRANCH) {
possibleThingTypes.push(com.novelgames.flashgames.snowman.Thing.TYPE_BRANCH);
_local2++;
}
_local2 = 0;
while (_local2 < com.novelgames.flashgames.snowman.Config.THING_WEIGHTCARROT) {
possibleThingTypes.push(com.novelgames.flashgames.snowman.Thing.TYPE_CARROT);
_local2++;
}
_local2 = 0;
while (_local2 < com.novelgames.flashgames.snowman.Config.THING_WEIGHTTREE) {
possibleThingTypes.push(com.novelgames.flashgames.snowman.Thing.TYPE_TREE);
_local2++;
}
}
function setY(y) {
var _local4 = -1;
var _local2;
this.y = y;
generateThings();
_local2 = 0;
while (_local2 < things.length) {
things[_local2]._y = y + things[_local2].y;
if ((y + things[_local2].y) < snowman._y) {
if (things[_local2].isBeforeSnowman) {
things[_local2].isBeforeSnowman = false;
if ((!snowman.destroyed) && (Math.abs(things[_local2]._x - snowman._x) < (snowman._width / 1))) {
snowman.hitThing(things[_local2]);
if (things[_local2].type != com.novelgames.flashgames.snowman.Thing.TYPE_TREE) {
things[_local2]._visible = false;
}
}
}
_local4 = _local2;
}
_local2++;
}
snowman.swapDepths(things[_local4].getDepth() + 10);
}
function generateThings() {
var _local3;
var _local6;
var _local2;
var _local7;
var _local4;
var _local5 = 0;
do {
if (((y + thingY) - com.novelgames.flashgames.snowman.Config.THING_MAXHEIGHT) > Stage.height) {
break;
}
_local3 = getNextHighestDepth() + 1;
_local6 = attachMovie("thing", "thing" + _local3, _local3);
_local2 = _local6;
_local7 = (snowman.completed ? (com.novelgames.flashgames.snowman.Thing.TYPE_SNOW) : (possibleThingTypes[Math.floor(Math.random() * possibleThingTypes.length)]));
_local4 = com.novelgames.flashgames.snowman.Config.THING_MINX + (Math.random() * (com.novelgames.flashgames.snowman.Config.THING_MAXX - com.novelgames.flashgames.snowman.Config.THING_MINX));
_local2.initialize(_local7, _local4, thingY);
_local2._x = _local4;
_local2._y = y + thingY;
things.push(_local2);
thingY = thingY + (com.novelgames.flashgames.snowman.Config.THING_MINSPACING + (Math.random() * (com.novelgames.flashgames.snowman.Config.THING_MAXSPACING - com.novelgames.flashgames.snowman.Config.THING_MINSPACING)));
_local5++;
} while (_local5 <= 10);
}
}
Symbol 189 MovieClip [__Packages.com.novelgames.flashgames.snowman.Ground] Frame 0
class com.novelgames.flashgames.snowman.Ground extends MovieClip
{
var leftShades, rightShades, _y, getNextHighestDepth, attachMovie;
function Ground () {
super();
}
function initialize() {
leftShades = new Array();
rightShades = new Array();
}
function setY(y) {
_y = y;
generateShades(leftShades, com.novelgames.flashgames.snowman.Config.GROUND_SHADELEFTMINX, com.novelgames.flashgames.snowman.Config.GROUND_SHADELEFTMAXX);
generateShades(rightShades, com.novelgames.flashgames.snowman.Config.GROUND_SHADERIGHTMINX, com.novelgames.flashgames.snowman.Config.GROUND_SHADERIGHTMAXX);
removeExtraShades(leftShades);
removeExtraShades(rightShades);
}
function generateShades(shades, minX, maxX) {
var _local3;
var _local4;
var _local2;
var _local6;
var _local5;
if (shades.length == 0) {
_local3 = (-_y) - com.novelgames.flashgames.snowman.Config.GROUND_SHADEMAXSPACING;
} else {
_local3 = shades[shades.length - 1]._y;
}
while ((_local3 + _y) < Stage.height) {
_local6 = minX + (Math.random() * (maxX - minX));
_local5 = (_local3 + com.novelgames.flashgames.snowman.Config.GROUND_SHADEMINSPACING) + (Math.random() * (com.novelgames.flashgames.snowman.Config.GROUND_SHADEMAXSPACING - com.novelgames.flashgames.snowman.Config.GROUND_SHADEMINSPACING));
_local4 = getNextHighestDepth();
_local2 = attachMovie("groundShade", "shade" + _local4, _local4);
_local2._x = _local6;
_local2._y = _local5;
_local2.cacheAsBitmap = true;
shades.push(_local2);
_local3 = _local5;
}
}
function removeExtraShades(shades) {
var _local2;
_local2 = 0;
while (_local2 < shades.length) {
if (((shades[_local2]._y + _y) + com.novelgames.flashgames.snowman.Config.GROUND_SHADEMAXSPACING) > 0) {
break;
}
shades[_local2].removeMovieClip();
_local2++;
}
if (_local2 > 0) {
shades.splice(0, _local2);
}
}
}
Symbol 190 MovieClip [__Packages.com.novelgames.flashgames.snowman.Game] Frame 0
class com.novelgames.flashgames.snowman.Game extends MovieClip
{
var y, speed, maxSpeed, gameOver, score, time, timerStarted, thingsHolder, snowman, ground, soundAdd, soundComplete, soundSnow, soundTree, soundGameOver, lastTime, startTime, intervalID, dialog, _parent;
function Game () {
super();
y = 0;
speed = 0;
maxSpeed = com.novelgames.flashgames.snowman.Config.SNOWMAN_INITIALMAXSPEED;
gameOver = false;
score = 0;
time = 0;
timerStarted = true;
thingsHolder.__proto__ = com.novelgames.flashgames.snowman.ThingsHolder.prototype;
thingsHolder.initialize();
thingsHolder.setY(snowman._y);
snowman = thingsHolder.snowman;
ground.__proto__ = com.novelgames.flashgames.snowman.Ground.prototype;
ground.initialize();
ground.setY(snowman._y);
soundAdd = new com.novelgames.flashgames.common.NewSound(this, "soundAdd");
soundComplete = new com.novelgames.flashgames.common.NewSound(this, "soundComplete");
soundSnow = new com.novelgames.flashgames.common.NewSound(this, "soundSnow");
soundTree = new com.novelgames.flashgames.common.NewSound(this, "soundTree");
soundGameOver = new com.novelgames.flashgames.common.NewSound(this, "soundGameOver");
lastTime = getTimer();
startTime = lastTime;
intervalID = setInterval(this, "onTime", 1);
}
function snowmanHitSnow() {
speed = speed * ((100 - com.novelgames.flashgames.snowman.Config.SNOWMAN_CLEARSPEEDDECREASE) / 100);
if (!timerStarted) {
timerStarted = true;
startTime = getTimer();
}
soundSnow.start();
}
function snowmanHitTree() {
speed = speed * ((100 - com.novelgames.flashgames.snowman.Config.SNOWMAN_CLEARSPEEDDECREASE) / 100);
if (!timerStarted) {
timerStarted = true;
startTime = getTimer();
}
soundTree.start();
}
function snowmanHitThing() {
score = score + com.novelgames.flashgames.snowman.Config.SCORE_THING;
soundAdd.start();
}
function snowmanCompleted() {
var _local2;
maxSpeed = maxSpeed + com.novelgames.flashgames.snowman.Config.SNOWMAN_MAXSPEEDINCREASE;
_local2 = com.novelgames.flashgames.snowman.Config.SCORE_TIMEBASE - (time * com.novelgames.flashgames.snowman.Config.SCORE_TIME);
if (_local2 < 0) {
_local2 = 0;
}
score = score + (com.novelgames.flashgames.snowman.Config.SCORE_SNOWMAN + _local2);
dialog.showComplete(time);
time = 0;
timerStarted = false;
soundComplete.start();
}
function snowmanDestroyed() {
gameOver = true;
dialog.showGameOver();
soundGameOver.start();
}
function showEnterHighScore() {
clearInterval(intervalID);
_parent.showEnterHighScore(score);
}
function onTime() {
var _local3 = getTimer();
var _local2 = (_local3 - lastTime) / 1000;
var _local4;
var _local6;
var _local5;
updateTime(_local3);
updateTurn(_local2);
_local4 = (speed * _local2) + (((com.novelgames.flashgames.snowman.Config.SNOWMAN_ACCELERATION * _local2) * _local2) / 2);
speed = speed + (com.novelgames.flashgames.snowman.Config.SNOWMAN_ACCELERATION * _local2);
if (speed > maxSpeed) {
speed = maxSpeed;
}
_local6 = snowman.directionX * _local4;
_local5 = snowman.directionY * _local4;
snowman._x = snowman._x + _local6;
if (snowman._x < com.novelgames.flashgames.snowman.Config.SNOWMAN_MINX) {
snowman._x = com.novelgames.flashgames.snowman.Config.SNOWMAN_MINX;
snowman.setAngle(0);
} else if (snowman._x > com.novelgames.flashgames.snowman.Config.SNOWMAN_MAXX) {
snowman._x = com.novelgames.flashgames.snowman.Config.SNOWMAN_MAXX;
snowman.setAngle(0);
}
y = y - _local5;
thingsHolder.setY(snowman._y + y);
ground.setY(snowman._y + y);
lastTime = _local3;
updateAfterEvent();
}
function updateTime(theTime) {
if (gameOver) {
return(undefined);
}
if (!timerStarted) {
return(undefined);
}
time = Math.floor((theTime - startTime) / 1000);
}
function updateTurn(seconds) {
if (gameOver) {
return(undefined);
}
if (Key.isDown(37)) {
snowman.turn(com.novelgames.flashgames.snowman.Config.SNOWMAN_TURNSPEED * seconds);
} else if (Key.isDown(39)) {
snowman.turn((-com.novelgames.flashgames.snowman.Config.SNOWMAN_TURNSPEED) * seconds);
}
}
}
Symbol 191 MovieClip [__Packages.com.novelgames.flashgames.common.MainDevelopment] Frame 0
class com.novelgames.flashgames.common.MainDevelopment extends MovieClip
{
var gotoAndStop, startButton, highScoresButton, moreGamesButton;
function MainDevelopment () {
super();
}
static function initialize(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.common.MainDevelopment.prototype;
movieClip.gotoTitlePage();
}
function gotoTitlePage() {
gotoAndStop("title");
startButton.onRelease = function () {
this._parent.gotoInstructionsPage();
};
highScoresButton.onRelease = function () {
this._parent.showHighScores();
};
moreGamesButton.onRelease = function () {
this._parent.getURL("http://www.novelgames.com", "_blank");
};
}
function gotoInstructionsPage() {
gotoAndStop("instructions");
startButton.onRelease = function () {
this._parent.gotoGamePage();
};
}
function gotoGamePage() {
gotoAndStop("game");
}
function showHighScores() {
trace("showHighScores()");
}
function showEnterHighScore(score) {
trace(("showEnterHighScore(" + score) + ")");
}
}