Frame 3
function awardrecieved() {
hits = hits + 5;
this.scoreclip.gotoAndPlay(2);
testforaward();
}
function setup() {
var _local1 = _global;
_local1.music = 1;
ballrad = 40;
_root.gamestatus = "playing";
_local1.score = 0;
yourhighest = 0;
_root.hits = 0;
ground = 350;
bx = 275;
by = 220;
kicked = 0;
xv = 0;
yv = 0;
elastic = 0.8;
stagewidth = 550;
middlepoint = stagewidth / 2;
ballrad = this.ball._width / 2;
gravity = 3;
_local1.skill = 2.8;
tnum = 1;
setupsounds();
_local1.playinglandsound = 0;
_local1.awards = 0;
}
function frameaction() {
if (_root.gamestatus == "lost") {
gamewait--;
if (gamewait < 1) {
skill = 3;
_root.hits = 0;
awards = 0;
i = 0;
while (i < 40) {
removeMovieClip(eval ("this.background.a" + i));
i++;
}
_root.gamestatus = "playing";
}
}
if (playinglandsound > 0) {
playinglandsound--;
if (playinglandsound < 1) {
playinglandsound = 0;
}
}
bx = bx + (xv / skill);
by = by + (yv / skill);
if (yv > 30) {
yv = 30;
}
if ((by > (ground - ballrad)) && (yv > 0)) {
yv = (-yv) * elastic;
xv = xv * elastic;
by = ground - ballrad;
if (gamestatus == "playing") {
if (playinglandsound == 0) {
playinglandsound = 500;
santa1.start();
}
if (hits > 0) {
_root.lastscore = hits;
if (hits < 61) {
saying = "EXCELLENT!!";
}
if (hits < 51) {
saying = "YOUR ON FIRE!";
}
if (hits < 41) {
saying = "Your getting good now!";
}
if (hits < 31) {
saying = "Your starting to do ok";
}
if (hits < 21) {
saying = "Getting better";
}
if (hits < 11) {
saying = "Hmmm, keep practicing";
}
if (hits < 6) {
saying = "That was terrible!";
}
if (_root.hits > _root.yourhighest) {
saying = "NEW BEST SCORE!";
}
this.sayit.gotoAndPlay(2);
if (_root.hits > _root.yourhighest) {
_root.yourhighest = _root.hits;
}
_root.gamestatus = "lost";
gamewait = 60;
}
}
}
yv = yv + gravity;
xv = xv * 0.95;
if (by < (-ballrad)) {
yv = 3;
by = -ballrad;
boing2.start();
}
if (bx < ballrad) {
bx = ballrad;
xv = (-xv) * elastic;
boing2.start();
}
if (bx > (stagewidth - ballrad)) {
bx = stagewidth - ballrad;
xv = (-xv) * elastic;
boing2.start();
}
ball._rotation = -Math.floor(275 - bx);
ball._x = Math.floor(bx);
ball._y = Math.floor(by);
this.shadowholder._x = bx;
scaleit = Math.floor(by / 3);
this.shadowholder._xscale = scaleit;
this.shadowholder._yscale = scaleit;
this.shadowholder._alpha = scaleit;
}
function testforaward() {
yes = 0;
switch (hits) {
case 20 :
yes = 1;
break;
case 40 :
yes = 2;
break;
case 50 :
yes = 3;
break;
case 70 :
yes = 4;
break;
case 90 :
yes = 5;
break;
case 110 :
yes = 6;
break;
case 125 :
yes = 7;
break;
case 140 :
yes = 8;
break;
case 150 :
yes = 9;
break;
case 170 :
yes = 10;
break;
}
if (yes > 0) {
this.awardholder.attachMovie("award", "a" + awards, awards + 10);
eval ("this.awardholder.a" + awards).gotoAndStop(yes);
eval ("this.awardholder.a" + awards)._x = mousex;
eval ("this.awardholder.a" + awards)._y = mousey;
awards++;
}
}
function kickit() {
var _local1 = _root;
if (gamestatus == "playing") {
click1.start();
playinglandsound = 0;
mousex = Math.floor(_local1._xmouse);
mousey = Math.floor(_local1._ymouse);
xv = (-(mousex - bx)) + random(10);
if (xv < 0) {
xv = xv - random(10);
}
if (xv > 0) {
xv = xv + random(10);
}
yv = ((-125 + (by - mousey)) / 4) - random(15);
_local1.hits = _local1.hits + 1;
skill = skill - 0.025;
if (skill < 1) {
skill = 1;
}
this.scoreclip.gotoAndPlay(2);
testforaward();
}
}
function setupsounds() {
var _local1 = _global;
_local1.santa1 = new Sound();
santa1.attachSound("santa1");
_local1.click1 = new Sound();
click1.attachSound("click1");
_local1.boing2 = new Sound();
boing2.attachSound("boing2");
_local1.click2 = new Sound();
_local1.soundtrack = new Sound();
soundtrack.attachSound("soundtrack");
soundtrack.start(0, 50);
}
function awardsClass() {
}
awardsClass.prototype = new MovieClip();
awardsClass.prototype.onLoad = function () {
var _local1 = this;
_local1.x = _root.ball._x;
_local1.y = _root.ball._y;
_local1.yv = 1;
_local1.fadeit = 0;
};
awardsClass.prototype.onEnterFrame = function () {
var _local1 = this;
if (_local1.y < ground) {
_local1.y = _local1.y + _local1.yv;
if (_local1.y > ground) {
_local1.yv = -_local1.yv;
_local1.yv = _local1.yv * 0.9;
_local1.y = ground - 1;
}
_local1.yv = _local1.yv * 0.97;
_local1.yv = _local1.yv + 1;
_local1._x = Math.floor(_local1.x);
_local1._y = Math.floor(_local1.y);
if (Math.abs(yv) < 1) {
_local1.a = Math.abs(_local1.y - ground);
if (_local1.a < 3) {
_local1.y = ground;
_local1.fadeit = 1;
}
}
}
if (_local1.fadeit == 1) {
_local1._alpha = _local1._alpha - 5;
if (_local1._alpha < 5) {
removeMovieClip(_local1);
}
}
};
Object.registerClass("award", awardsClass);
Frame 22
setup();
stop();
Instance of Symbol 90 MovieClip in Frame 22
onClipEvent (enterFrame) {
_root.frameaction();
}
Symbol 2 MovieClip [present] Frame 1
this._y = this._y + 2;
if (this._y > 420) {
removeMovieClip(this);
}
Symbol 6 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
_root.play();
}
Symbol 6 MovieClip Frame 2
gotoAndPlay (1);
Symbol 19 Button
on (press) {
if (_root.gamestatus == "playing") {
trace(_root.gameststus);
_root.awardrecieved();
this.gotoAndPlay(30);
}
}
Symbol 41 MovieClip [award] Frame 90
removeMovieClip(this);
Symbol 42 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 55 Button
on (release) {
if (music == 1) {
music = 2;
stopAllSounds();
onoff.gotoAndStop(2);
} else if (music == 2) {
music = 1;
soundtrack.start(0, 50);
onoff.gotoAndStop(1);
}
}
Symbol 58 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 66
this.gotoAndStop(1);
Symbol 73 Button
on (press) {
_root.kickit();
}
Symbol 74 MovieClip Frame 1
stop();
Symbol 83 Button
on (press) {
_root.play();
}
Symbol 84 MovieClip Frame 1
_root.stop();
Symbol 84 MovieClip Frame 2
stop();