Frame 1
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
if (_root.soundon == undefined) {
_root.soundon = true;
}
stop();
Instance of Symbol 10 MovieClip in Frame 1
onClipEvent (enterFrame) {
text = ((int(_parent.getBytesLoaded() / 1000) add " KBYTES OF ") add int(_parent.getBytesTotal() / 1000)) add " LOADED ...";
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_parent.gotoAndStop(2);
}
}
Instance of Symbol 7 MovieClip [empty] in Frame 1
onClipEvent (enterFrame) {
myURL = _url;
okDomain = "tonypa.pri.ee";
if (myURL.indexOf(okDomain) == -1) {
}
}
Frame 2
function buildMap() {
game.clip = _root.stage;
char.clip = game.clip.char;
char.x = game.stageW / 2;
char.y = game.stageH - char.size;
placeChar(char);
game.wheels = [];
game.points = [];
game.score = 0;
game.gravity = game.baseGravity;
game.startTime = int(getTimer() / 1000) + 300;
game.clip.gotoAndStop(random(3) + 1);
resetBonus();
}
function startWheel(ob) {
game.wheels.push(ob);
var s = (game.wheelTurn / ob._width);
ob.speed = ((2 * s) * s) * ((random(2) * 2) - 1);
ob.size = ob._width / 2;
ob.startY = ob._y;
ob.gotoAndStop(random(3) + 1);
}
function startPoint(ob) {
game.points.push(ob);
game.pointsToGo++;
ob.x = ob._x;
ob.y = ob._y;
}
function moveChar(ob) {
ob.x = ob.x + ob.speedX;
ob.y = ob.y + ob.speedY;
if ((game.stageW - ob.size) < ob.x) {
ob.x = game.stageW - ob.size;
if (ob.wheel != "none") {
ob.speedX = ob.speedX * -0.9;
}
} else if (ob.x < ob.size) {
ob.x = ob.size;
if (ob.wheel != "none") {
ob.speedX = ob.speedX * -0.9;
}
}
if ((game.stageH - ob.size) < ob.y) {
ob.y = game.stageH - ob.size;
ob.jump = false;
ob.jumpAngle = -90;
ob.wheel = "none";
} else if (ob.y < ob.size) {
}
var i = 0;
while (i < game.wheels.length) {
if (game.wheels[i].hitTest(ob.x + game.clip._x, ob.y + game.clip._y, true)) {
ob.wheel = game.wheels[i];
rotateTowards(ob);
ob.wheelAngle = ob.wheelAngle - ob.wheel._rotation;
ob.jump = false;
var angle = degToRad(ob.wheelAngle + ob.wheel._rotation);
ob.x = ob.wheel._x + (ob.wheel.size * Math.cos(angle));
ob.y = ob.wheel._y + (ob.wheel.size * Math.sin(angle));
}
i++;
}
var i = 0;
while (i < game.points.length) {
var p = game.points[i];
if (p.picked == undefined) {
var distx = (p.x - ob.x);
var disty = (p.y - ob.y);
var dist = ((distx * distx) + (disty * disty));
if (dist < ob.size2) {
addSound("s_point");
game.score++;
game.pointsToGo--;
p.play();
p.picked = true;
if (0 >= game.pointsToGo) {
game.score = game.score + border.time;
border.points = game.score;
_root.gotoAndStop(4);
}
}
}
i++;
}
placeChar(ob);
}
function placeChar(ob) {
ob.clip._x = ob.x;
ob.clip._y = ob.y;
var y = 0;
if (game.visH < ob.y) {
y = game.visH - ob.y;
}
if (y < (-(game.stageH - (game.visH * 2)))) {
y = -(game.stageH - (game.visH * 2));
}
game.clip._y = y;
}
function doJump(ob) {
var angle = Math.atan2(ob.speedY, ob.speedX);
var speed = Math.sqrt((ob.speedX * ob.speedX) + (ob.speedY * ob.speedY));
ob.speedX = speed * Math.cos(angle);
ob.speedY = game.gravity + (speed * Math.sin(angle));
if (game.maxSpeed < ob.speedY) {
ob.speedY = game.maxSpeed;
} else if (ob.speedY < (-game.maxSpeed)) {
ob.speedY = -game.maxSpeed;
}
if (game.maxSpeed < ob.speedX) {
ob.speedX = game.maxSpeed;
} else if (ob.speedX < (-game.maxSpeed)) {
ob.speedX = -game.maxSpeed;
}
moveChar(ob);
}
function resetBonus() {
game.bonus = 0;
game.bonusTime = (int(getTimer() / 1000) + 5) + random(10);
game.clip.bonus.y = -5;
game.clip.bonus._y = game.clip.bonus.y;
game.clip.bonus.x = random(game.stageW - 10) + 5;
game.clip.bonus._x = game.clip.bonus.x;
}
function moveBonus() {
game.clip.bonus.y = game.clip.bonus.y + game.gravity;
game.clip.bonus._y = game.clip.bonus.y;
var distx = (game.clip.bonus.x - char.x);
var disty = (game.clip.bonus.y - char.y);
var dist = ((distx * distx) + (disty * disty));
if (dist < char.size2) {
addSound("s_bonus");
game.clip.bonus.play();
game.bonus = 2;
var b = (random(4) + 2);
border.bonusmsg.gotoAndStop(b);
if (b == 2) {
game.startTime = game.startTime + 10;
} else if (b == 3) {
game.score = game.score + 10;
} else if (b == 4) {
game.gravity = 0;
} else if (b == 5) {
game.wheelsStop = true;
}
}
if ((game.stageH + 5) < game.clip.bonus.y) {
resetBonus();
}
}
function rotateTowards(ob) {
var deltaX = (ob.wheel._x - ob.x);
var deltaY = (ob.wheel._y - ob.y);
var rotationRadian = Math.atan2(-deltaY, -deltaX);
ob.wheelAngle = radiansToDegrees(rotationRadian);
}
function radiansToDegrees(radians) {
return((radians / Math.PI) * 180);
}
function degToRad(ang) {
var angR = ((ang * Math.PI) / 180);
return(angR);
}
function addSound(s_id) {
if (_root.soundon) {
this[s_id] = new Sound();
var s = this[s_id];
s.attachSound(s_id);
s.start();
}
}
function addMusic() {
if (_root.soundon) {
_root.music.stop();
_root.music = new Sound();
_root.music.attachSound("music");
_root.music.start(0, 999);
}
}
function detectKeys() {
if (game.paused) {
if (Key.isDown(Key.ENTER)) {
if (game.pauseKeyFree) {
game.paused = false;
border.gotoAndStop(1);
game.startTime = int(getTimer() / 1000) + border.time;
}
} else {
game.pauseKeyFree = true;
}
return(undefined);
}
border.points = game.score;
border.time = game.startTime - int(getTimer() / 1000);
if ((10 >= border.time) and (border.time < game.beepTime)) {
game.beepTime = border.time;
addSound("s_end");
}
if (0 >= border.time) {
_root.gotoAndStop(4);
}
if (game.bonus == 1) {
moveBonus();
} else if ((game.bonus == 0) and (game.bonusTime < int(getTimer() / 1000))) {
game.bonus = true;
}
if (!game.wheelsStop) {
var i = 0;
while (i < game.wheels.length) {
var ob = game.wheels[i];
var rot = ob._rotation;
rot = rot + ob.speed;
if (360 < rot) {
rot = rot - 360;
} else if (rot < -360) {
rot = rot + 360;
}
ob._rotation = rot;
i++;
}
}
var ob = char;
var keyPressed = false;
if (ob.jump) {
doJump(ob);
} else {
if (Key.isDown(Key.RIGHT)) {
if (ob.wheel == "none") {
ob.speedX = ob.speed;
ob.speedY = 0;
moveChar(ob);
}
} else if (Key.isDown(Key.LEFT)) {
if (ob.wheel == "none") {
ob.speedX = -ob.speed;
ob.speedY = 0;
moveChar(ob);
}
} else if ((Key.isDown(Key.SPACE) or Key.isDown(Key.SHIFT)) or Key.isDown(Key.CONTROL)) {
if (game.keysFree) {
addSound("s_jump");
game.keysFree = false;
ob.jump = true;
if (ob.wheel == "none") {
ob.speedX = ob.jumpSpeed * Math.cos(degToRad(ob.jumpAngle));
ob.speedY = ob.jumpSpeed * Math.sin(degToRad(ob.jumpAngle));
} else {
var angle = (ob.wheelAngle + ob.wheel._rotation);
var speed = (ob.jumpSpeed + (Math.abs(ob.wheel.speed) / 1.5));
ob.speedX = speed * Math.cos(degToRad(angle));
ob.speedY = speed * Math.sin(degToRad(angle));
}
}
} else if (Key.isDown(Key.ENTER)) {
if (game.keysFree) {
game.keysFree = false;
game.paused = true;
game.pauseKeyFree = false;
border.gotoAndStop(2);
}
} else {
game.keysFree = true;
}
if (ob.wheel != "none") {
var angle = degToRad(ob.wheelAngle + ob.wheel._rotation);
ob.x = ob.wheel._x + (ob.wheel.size * Math.cos(angle));
ob.y = ob.wheel._y + (ob.wheel.size * Math.sin(angle));
placeChar(ob);
}
}
}
fscommand ("allowscale", false);
game = {stageW:300, stageH:1200, visH:200, baseGravity:0.6, wheelTurn:100, maxSpeed:10, wheelsStop:false, paused:false, beepTime:500};
char = {speed:6, size:10, wheel:"none", jumping:false, jumpSpeed:8, jumpAngle:-90};
char.size2 = char.size * char.size;
border.points = 0;
border.time = 0;
stopAllSounds();
addMusic();
Instance of Symbol 41 MovieClip "heli_nupp" in Frame 2
onClipEvent (load) {
if (_root.soundon == false) {
gotoAndStop (2);
}
}
Instance of Symbol 84 MovieClip "scoretable" in Frame 2
onClipEvent (enterFrame) {
if (_root._currentframe != 5) {
this._visible = false;
} else {
this._visible = true;
}
}
Frame 3
buildMap();
stop();
Instance of Symbol 85 MovieClip "controller" in Frame 3
onClipEvent (enterFrame) {
_root.detectKeys();
}
Frame 4
border.bonusmsg.gotoAndStop(1);
Symbol 13 Button
on (release) {
gotoAndStop (3);
}
Symbol 37 MovieClip Frame 1
stop();
Instance of Symbol 20 MovieClip in Symbol 37 MovieClip Frame 1
onClipEvent (load) {
startTime = getTimer() + 5000;
frame = 1;
}
onClipEvent (enterFrame) {
if (startTime < getTimer()) {
startTime = getTimer() + 5000;
frame++;
if (_parent._totalframes < frame) {
frame = 1;
}
_parent.gotoAndStop(frame);
}
}
Instance of Symbol 24 MovieClip in Symbol 37 MovieClip Frame 1
onClipEvent (load) {
_root.startWheel(_parent);
}
Symbol 38 Button
on (release) {
if (_root.soundon) {
_root.soundon = false;
} else {
_root.soundon = true;
}
play();
}
Symbol 41 MovieClip Frame 1
stopAllSounds();
if (_root.soundon) {
_root.addMusic();
}
stop();
Symbol 41 MovieClip Frame 2
stopAllSounds();
stop();
Symbol 52 MovieClip Frame 1
_root.game.gravity = _root.game.baseGravity;
_root.game.wheelsStop = false;
stop();
Instance of Symbol 48 MovieClip in Symbol 52 MovieClip Frame 2
onClipEvent (load) {
time = getTimer() + 10000;
}
onClipEvent (enterFrame) {
if (time < getTimer()) {
_parent.gotoAndStop(1);
}
}
Symbol 57 Button
on (release) {
_root.gotoAndPlay(1);
}
Symbol 59 MovieClip Frame 1
stopAllSounds();
if (_root.soundon) {
_root.addMusic();
}
stop();
Symbol 59 MovieClip Frame 2
stopAllSounds();
stop();
Symbol 60 MovieClip Frame 1
stop();
Instance of Symbol 59 MovieClip "heli_nupp" in Symbol 60 MovieClip Frame 2
onClipEvent (load) {
if (_root.soundon == false) {
gotoAndStop (2);
}
}
Instance of Symbol 24 MovieClip in Symbol 89 MovieClip Frame 1
onClipEvent (load) {
_root.startWheel(_parent);
}
Symbol 93 MovieClip Frame 1
stop();
Instance of Symbol 91 MovieClip in Symbol 93 MovieClip Frame 1
onClipEvent (load) {
_root.startPoint(_parent);
}
Symbol 93 MovieClip Frame 6
stop();
Symbol 94 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 10
_root.resetBonus();
Symbol 100 Button
on (release) {
gotoAndStop (2);
}
Symbol 104 Button
on (release) {
scoretable.filename = "scores/wheels.sco";
scoretable.scoresize = 10;
scoretable.action = "INSERT";
scoretable.viewtype = "FLASH";
scoretable.winname = _root.my_name;
scoretable.winscore = _root.game.score;
scoretable.loadVariables("scores.php", "POST");
nextFrame();
}