Frame 12
totalData = _root.getBytesTotal();
loadedData = _root.getBytesLoaded();
Postep = Math.round((loadedData / totalData) * 100);
procent_txt.text = Postep + "%";
trace(_root._framesloaded);
if (_root._framesloaded == 29) {
gotoAndPlay (16);
}
Frame 13
gotoAndPlay (12);
Frame 26
tloMusic = new Sound();
tloMusic.attachSound("music");
tloMusic.start(0, 9999);
tloMusic.setVolume(100);
Frame 27
stop();
Frame 29
function ustawieniaGry() {
kierunekMikolaja = "down";
przyspieszenie = 0.35;
opor = 0.92;
oporDomku = 0.94;
predkoscLotu = 35;
predkosc = -2;
predkoscPozioma = 3;
czyBoli = false;
czyDomPrzesuniety = false;
dach_mc._x = 250;
czyWkominie = true;
naDechach = false;
santaBallsPower = 100;
akPower = santaBallsPower;
power_mc.gotoAndStop(100);
pozdrowienia_mc._visible = false;
punkty = -1;
lewel = 2;
zasieg = 1;
startGry = true;
dachy_mc._x = 0;
komin_mc._x = 145;
komin2_mc._x = -305;
mikolaj_mc._x = komin_mc._x;
komin_mc.gotoAndStop(1);
prezentOn = false;
pr = false;
czyMozeSkrecac = true;
mozeskrecac = 400;
isVisited = false;
}
function ustawieniaDzwiekow() {
jajkaFx = new Sound();
jajkaFx.attachSound("Jajka");
AuFx = new Sound();
AuFx.attachSound("Au");
FallBodyFx = new Sound();
FallBodyFx.attachSound("FallBody");
WyskokKominFx = new Sound();
WyskokKominFx.attachSound("WyskokKomin");
ZebranieprezentuFx = new Sound();
ZebranieprezentuFx.attachSound("Zebranieprezentu");
}
function sprawdzMozliwoscSkrecania() {
if (komin_mc._currentframe < 4) {
mozeskrecac = 400;
}
if ((komin_mc._currentframe > 3) and (komin_mc._currentframe < 7)) {
mozeskrecac = 250;
}
if (komin_mc._currentframe > 6) {
mozeskrecac = 100;
}
if (mikolaj_mc._x <= mozeskrecac) {
czyMozeSkrecac = true;
} else {
czyMozeSkrecac = false;
}
}
function przesunDachy() {
pr = false;
komin2_mc.gotoAndStop(random(lewel) + zasieg);
var _local3 = new mx.transitions.Tween(komin2_mc, "_x", mx.transitions.easing.Regular.easeOut, komin2_mc._x, komin2_mc._x + 500, 1, true);
var _local4 = new mx.transitions.Tween(komin_mc, "_x", mx.transitions.easing.Regular.easeOut, komin_mc._x, komin_mc._x + 500, 1, true);
var _local5 = new mx.transitions.Tween(dachy_mc, "_x", mx.transitions.easing.Regular.easeOut, dachy_mc._x, dachy_mc._x + 500, 1, true);
var _local1 = new mx.transitions.Tween(polePrezent.p1, "_x", mx.transitions.easing.Regular.easeOut, polePrezent.p1._x, polePrezent.p1._x + 500, 1, true);
var _local2 = new mx.transitions.Tween(niebo_mc, "_x", mx.transitions.easing.Regular.easeOut, niebo_mc._x, niebo_mc._x + 100, 1, true);
}
function zamienDachy() {
trace(dachy_mc._x);
if (dachy_mc._x == 500) {
dachy_mc._x = 0;
komin_mc.gotoAndStop(komin2_mc._currentframe);
komin_mc._x = komin2_mc._x;
komin2_mc._x = (random(300) + 100) - 500;
isVisited = false;
}
}
wyskokDzwiek = function () {
WyskokKominFx.start(0, 1);
WyskokKominFx.setVolume(70);
};
DeathDzwiek = function () {
FallBodyFx.start(0, 1);
FallBodyFx.setVolume(100);
AuFx.start(0, 1);
AuFx.setVolume(100);
};
prezentDzwiek = function () {
ZebranieprezentuFx.start(0, 1);
ZebranieprezentuFx.setVolume(100);
};
walnijWJajka = function () {
jajkaFx.start(0, 1);
jajkaFx.setVolume(100);
AuFx.start(0, 1);
AuFx.setVolume(100);
};
powiekszPunkty = function () {
var _local1 = new TextFormat();
_local1.font = "Optima";
pointsy.antiAliasType = "normal";
pointsy.embedFonts = true;
pointsy.setNewTextFormat(_local1);
pointsy.text = punkty;
};
wyswietlWynik = function () {
var _local1 = new TextFormat();
_local1.font = "Optima";
pozdrowienia_mc.z.punkty.antiAliasType = "normal";
pozdrowienia_mc.z.punkty.embedFonts = true;
pozdrowienia_mc.z.punkty.setNewTextFormat(_local1);
tp = punkty;
if (tp < 10) {
tp = "00" + tp;
}
if ((tp >= 10) and (tp < 100)) {
tp = "0" + tp;
}
pozdrowienia_mc.z.punkty.text = tp;
};
kG.onEnterFrame = function () {
sprawdzMozliwoscSkrecania();
if (startGry == true) {
if (polePrezent.p1.hitTest(mikolaj_mc) and (polePrezent.p1._visible == true)) {
punkty++;
powiekszPunkty();
prezentDzwiek();
skasujPrezent();
}
sprawdzLevel();
zmienPower();
if (((mikolaj_mc.hitTest(komin_mc) == false) and (isVisited == false)) and (kierunekMikolaja == "up")) {
isVisited = true;
przesunDachy();
}
if ((mikolaj_mc.hitTest(komin_mc) == false) and (czyMozeSkrecac == true)) {
sprawdzKierunek();
}
if (niebo_mc._x == 500) {
niebo_mc._x = 0;
}
sprawdzCzyTrafil();
if (kierunekMikolaja == "up") {
mikolajWGore();
if (czyBoli == false) {
mikolajWGore();
}
}
if (kierunekMikolaja == "down") {
mikolajWDol();
}
}
};
mikolajWGore = function () {
predkosc = predkosc * opor;
if (predkosc < 1) {
predkosc = 0;
}
przesunMikea();
};
mikolajWDol = function () {
predkosc = predkosc - przyspieszenie;
przesunMikea();
};
przesunMikea = function () {
if (naDechach != true) {
mikolaj_mc._y = mikolaj_mc._y - predkosc;
if ((predkosc == 0) and (kierunekMikolaja == "up")) {
predkosc = -1;
if (czyBoli == false) {
mikolaj_mc.gotoAndPlay("Spada");
trace("Spadam");
}
if (czyBoli == true) {
mikolaj_mc.gotoAndPlay("SpadaLoop");
}
kierunekMikolaja = "down";
}
if (((mikolaj_mc._y >= 450) and (kierunekMikolaja == "down")) and (czyWkominie == true)) {
czyMozeSkrecac = false;
mikolaj_mc.gotoAndPlay("Dogory");
predkosc = predkoscLotu;
kierunekMikolaja = "up";
czyBoli = false;
czyDomPrzesuniety = false;
mikolaj_mc.butP._visible = true;
mikolaj_mc.butL._visible = true;
punkty++;
powiekszPunkty();
wyskokDzwiek();
losujPrezent();
zamienDachy();
}
if ((mikolaj_mc._y <= 400) and (kierunekMikolaja == "up")) {
czyWkominie = false;
czyMozeSkrecac = true;
}
}
};
sprawdzKierunek = function () {
odleglosc = Math.abs(mikolaj_mc._xmouse);
if ((odleglosc > 0) and (odleglosc <= 10)) {
predkoscPozioma = 0.5;
}
if ((odleglosc > 10) and (odleglosc < 100)) {
predkoscPozioma = 1;
}
if ((odleglosc >= 100) and (odleglosc < 200)) {
predkoscPozioma = 3;
}
if ((odleglosc >= 200) and (odleglosc < 300)) {
predkoscPozioma = 6;
}
if ((odleglosc >= 300) and (odleglosc < 400)) {
predkoscPozioma = 9;
}
if (odleglosc >= 400) {
predkoscPozioma = 12;
}
if (mikolaj_mc._xmouse > 0) {
mikolaj_mc._x = mikolaj_mc._x + predkoscPozioma;
}
if (mikolaj_mc._xmouse < 0) {
mikolaj_mc._x = mikolaj_mc._x - predkoscPozioma;
}
};
sprawdzCzyTrafil = function () {
if ((mikolaj_mc.twarz.hitTest(komin2_mc.hpKomin) and (kierunekMikolaja == "down")) or (mikolaj_mc.twarz.hitTest(komin_mc.hpKomin) and (kierunekMikolaja == "down"))) {
mikolaj_mc.butP._visible = false;
mikolaj_mc.butL._visible = false;
}
if ((mikolaj_mc.brzuch.hitTest(komin2_mc.hpKomin) and (kierunekMikolaja == "down")) or (mikolaj_mc.brzuch.hitTest(komin_mc.hpKomin) and (kierunekMikolaja == "down"))) {
czyWkominie = true;
}
if ((mikolaj_mc.brzuch.hitTest(dachy_mc) and (kierunekMikolaja == "down")) and (czyWkominie == false)) {
predkosc = 0;
naDechach = true;
mikolaj_mc.gotoAndPlay("naDechach");
pozdrowienia_mc._visible = true;
pozdrowienia_mc.gotoAndPlay(2);
wyswietlWynik();
DeathDzwiek();
startGry = false;
}
if (mikolaj_mc.brzuch.hitTest(komin2_mc.hp1) or mikolaj_mc.brzuch.hitTest(komin2_mc.hp2)) {
mikolaj_mc.gotoAndPlay("Jaja");
kierunekMikolaja = "up";
walnijWJajka();
predkosc = predkoscLotu / 3;
czyBoli = true;
santaBallsPower = santaBallsPower - 10;
czymozeSkrecac = true;
}
};
sprawdzLevel = function () {
if (punkty < 10) {
lewel = 2;
zasieg = 1;
}
if ((punkty >= 10) and (punkty < 20)) {
lewel = 4;
zasieg = 1;
}
if ((punkty >= 20) and (punkty < 30)) {
lewel = 3;
zasieg = 3;
}
if ((punkty >= 30) and (punkty < 40)) {
lewel = 3;
zasieg = 4;
}
if ((punkty >= 40) and (punkty < 50)) {
lewel = 3;
zasieg = 5;
}
if (punkty >= 50) {
lewel = 4;
zasieg = 6;
}
};
zmienPower = function () {
if (santaBallsPower > 0) {
power_mc.gotoAndStop(santaBallsPower);
}
if (santaBallsPower <= 0) {
startGry = false;
pozdrowienia_mc._visible = true;
pozdrowienia_mc.gotoAndPlay(2);
wyswietlWynik();
power_mc.gotoAndStop(1);
mikolaj_mc.gotoAndPlay("Jaja");
startGry = false;
var _local1 = new mx.transitions.Tween(mikolaj_mc, "_y", mx.transitions.easing.Regular.easeOut, mikolaj_mc._y, mikolaj_mc._y + 10, 1, true);
}
};
losujPrezent = function () {
if (prezentOn == false) {
prz = random(10) + 1;
if (prz == 6) {
_root.polePrezent.attachMovie("prezent", "p1", getNextHighestDepth(), {_x:random(400) - 450, _y:random(149) + 26});
prezentOn = true;
}
}
};
skasujPrezent = function () {
prezentOn = false;
polePrezent.p1.removeMovieClip();
};
ustawieniaGry();
ustawieniaDzwiekow();
stop();
Symbol 4 MovieClip [prezent] Frame 48
_root.skasujPrezent();
stop();
Symbol 160 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 161 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 162 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 163 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 72 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 1
stop();
Symbol 104 Button
on (release) {
gotoAndPlay (38);
}
Symbol 105 MovieClip Frame 37
stop();
Symbol 105 MovieClip Frame 53
_parent.gotoAndPlay(28);
stop();
Symbol 107 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 20
gotoAndPlay ("Dogory");
Symbol 148 MovieClip Frame 38
gotoAndPlay ("SpadaLoop");
Symbol 148 MovieClip Frame 59
stop();
Symbol 148 MovieClip Frame 79
stop();
Symbol 158 Button
on (release) {
_root.gotoAndPlay(28);
}
Symbol 159 MovieClip Frame 53
stop();