Frame 1
stop();
Frame 2
stop();
Frame 3
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
stop();
Frame 7
stop();
Frame 8
function getBoundary() {
var _local1 = new Array();
_local1 = [xmin, ymin, xmax, ymax];
return(_local1);
}
function gameOver() {
gotoAndStop ("finish");
}
stop();
frame_mc.swapDepths(9000);
main_object._visible = false;
var xmin = 10;
var ymin = 50;
var xmax = 530;
var ymax = 400;
var GC = (new com.interfuel.GameControl());
player.init();
var OG = (new com.interfuel.ObjectGenerator());
GC.addListener(OG);
OG.addListener(GC);
GC.startGame();
Frame 9
stopAllSounds();
GC.showResults();
frame_end.score_txt.text = GC.score;
Symbol 3 MovieClip [score_display] Frame 1
#initclip 7
Object.registerClass("score_display", com.interfuel.ScoreDisplay);
#endinitclip
Symbol 25 Button
on (press) {
getURL ("http://www.interfuel.com", "_blank");
}
Symbol 30 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
_root.play();
} else {
bar._xscale = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
}
};
Symbol 222 MovieClip [__Packages.com.interfuel.ScoreDisplay] Frame 0
class com.interfuel.ScoreDisplay extends MovieClip
{
var duration, step, count, onEnterFrame, _y, _alpha, removeMovieClip;
function ScoreDisplay () {
super();
}
function init() {
duration = 60;
step = 2;
count = 0;
onEnterFrame = doSomething;
}
function doSomething() {
count++;
if (count >= duration) {
remove();
} else {
_y = _y - step;
if (count > (duration / 2)) {
_alpha = _alpha - 2;
}
}
}
function remove() {
removeMovieClip();
}
}
Symbol 223 MovieClip [__Packages.com.interfuel.GameControl] Frame 0
class com.interfuel.GameControl
{
var time, levelTime, maxLevel, score, maxScore, intervalID, levelInterval, level, minObjects, maxObjects, broadcastMessage;
function GameControl () {
AsBroadcaster.initialize(this);
}
function startGame() {
time = 1500;
levelTime = 30;
maxLevel = 3;
score = 0;
maxScore = 1000;
intervalID = null;
levelInterval = null;
initLevel(1);
resetInterval(1);
setScoreText(score);
_root.frame_mc.clock_mc.startClock();
}
function initLevel(val) {
if (levelInterval == null) {
setTimer();
}
if (val <= 3) {
level = val;
minObjects = 1 + level;
maxObjects = 3 + level;
onLevel();
setLevelText(level);
} else {
endGame();
}
}
function setTimer() {
levelInterval = setInterval(_root.GC.nextLevel, 1000 * levelTime);
}
function nextLevel() {
if (_root.GC.level < 1) {
_root.GC.time = _root.GC.time - 200;
}
_root.GC.initLevel(_root.GC.level + 1);
}
function onLevel() {
var _local2 = new Object();
_local2.value = level;
broadcastMessage("onLevel", _local2);
}
function onCreateObject(ob) {
var _local2 = ob.value;
if (_local2 < maxObjects) {
resetInterval(1);
} else {
resetInterval(0);
}
}
function onDestroyObject(ob) {
if (_root.OG.getTotalObjects() < maxObjects) {
resetInterval(1);
}
}
function resetInterval(val) {
clearInterval(intervalID);
if (val == 1) {
intervalID = setInterval(_root.OG.go, random(time));
} else {
intervalID = null;
}
}
function showScore(mc, type) {
setScoreText(mc.score);
if (type == 1) {
_root.player.clip.hit_mc.gotoAndPlay("good");
} else {
_root.player.clip.hit_mc.gotoAndPlay("bad");
}
onScore(mc);
}
function onScore(mc) {
var _local2 = new Object();
_local2.target = mc;
_local2.score = mc.score;
broadcastMessage("onScore", _local2);
}
function setLevelText(val) {
_root.frame_mc.level_txt.text = val;
}
function setScoreText(val) {
score = score + val;
_root.frame_mc.score_txt.text = score;
if ((score >= 1000) || (score <= -1000)) {
endGame();
}
}
function endGame() {
clearInterval(_root.GC.levelInterval);
_root.OG.destroyObjects();
resetInterval(0);
_root.frame_mc.clock_mc.stopClock();
_root.gameOver();
}
function showResults() {
_root.frame_mc.removeMovieClip();
if (score > 0) {
_root.results_mc.gotoAndStop(2);
} else {
_root.results_mc.gotoAndStop(3);
}
}
}
Symbol 224 MovieClip [__Packages.com.interfuel.ObjectGenerator] Frame 0
class com.interfuel.ObjectGenerator
{
var depth, xmin, xmax, ymin, objects, broadcastMessage, level;
function ObjectGenerator () {
AsBroadcaster.initialize(this);
init();
}
function init() {
destroyObjects();
setBoundary();
}
function go() {
_root.OG.generateObject();
}
function generateObject() {
duplicateMovieClip ("main_object", "object" + depth, depth);
var _local3 = _root["object" + depth];
_local3._x = random(xmax - xmin);
_local3._y = ymin - _local3._height;
_local3.init();
objects.push(_local3);
depth++;
onCreateObject();
}
function onCreateObject() {
var _local2 = new Object();
_local2.value = objects.length;
broadcastMessage("onCreateObject", _local2);
}
function onDestroyObject(ob) {
var _local3 = ob.target;
var _local2 = 0;
while (_local2 < objects.length) {
if (objects[_local2] == _local3) {
objects.splice(_local2, 1);
break;
}
_local2++;
}
_local3.remove();
}
function destroyObjects() {
for (var _local2 in objects) {
objects[_local2].removeMovieClip();
}
objects = new Array();
depth = 1;
}
function onLevel(ob) {
level = ob.value;
}
function setBoundary() {
var _local3 = _root.getBoundary();
xmin = _local3[0];
ymin = _local3[1];
xmax = _local3[2];
}
function getTotalObjects() {
return(objects.length);
}
function onScore(event) {
}
function displayScore(mc) {
_root.attachMovie("score_display", "display" + depth, depth);
var _local3 = _root["display" + depth];
var _local4 = Math.max(_root.player._x, (_local3._width / 2) + xmin);
var _local5 = Math.min(_local4, xmax - (_local3._width / 2));
_local3._x = _local5;
_local3._y = _root.player._y - _root.player._height;
_local3.score = mc.score;
_local3.init();
depth++;
}
}
Symbol 225 MovieClip [__Packages.com.interfuel.Player] Frame 0
class com.interfuel.Player extends MovieClip
{
var speed, minSpeed, maxSpeed, speedInc, active, onEnterFrame, xdirection, _currentframe, gotoAndStop, clip, _x, xmin, hitarea, xmax;
function Player () {
super();
xDir = (0);
speed = 0;
minSpeed = 0;
maxSpeed = 15;
speedInc = 0.5;
AsBroadcaster.initialize(this);
}
function init() {
getGameBounds();
active = true;
onEnterFrame = onInterval;
}
function getKey() {
xdirection = 0;
if (Key.isDown(37) && (Key.getCode() == 37)) {
xdirection = -1;
}
if (Key.isDown(39) && (Key.getCode() == 39)) {
xdirection = 1;
}
}
function onInterval() {
if (active) {
getKey();
if (xdirection != 0) {
var _local2 = ((xdirection == -1) ? 2 : 1);
if (_currentframe != _local2) {
(gotoAndStop(_local2));// not popped
}
}
speed = getSpeed(xdirection);
if (speed == minSpeed) {
clip.gotoAndStop("stopFrame");
} else if (clip.frameLabel == "stopFrame") {
clip.play();
}
_x = _x + speed;
checkPosition();
}
}
function checkPosition() {
if ((_x - (hitarea._width / 2)) < xmin) {
_x = xmin + (hitarea._width / 2);
} else if ((_x + (hitarea._width / 2)) > xmax) {
_x = xmax - (hitarea._width / 2);
}
}
function getSpeed(dir) {
if (dir == 1) {
return(Math.min(speed + speedInc, maxSpeed));
}
if (dir == -1) {
return(Math.max(speed + (speedInc * dir), maxSpeed * dir));
}
return(minSpeed);
}
function getGameBounds() {
var _local3 = _root.getBoundary();
xmin = _local3[0];
xmax = _local3[2];
}
function set xDir(val) {
xdirection = val;
//return(xDir);
}
function get xDir() {
return(xdirection);
}
}
Symbol 226 MovieClip [__Packages.com.interfuel.FallingObject] Frame 0
class com.interfuel.FallingObject extends MovieClip
{
var level, aoa, maxSpeed, minSpeed, speed, badFrame, _totalframes, gotoAndStop, objectType, score, addListener, onEnterFrame, onPress, angle, _x, xstep, _y, ystep, ymax, hitTest, xmid, broadcastMessage, removeMovieClip, xmin, ymin, xmax;
function FallingObject () {
super();
level = _root.GC.level;
aoa = 40;
maxSpeed = 9;
minSpeed = 6;
speed = Math.max(random(maxSpeed) + level, minSpeed);
badFrame = 29;
AsBroadcaster.initialize(this);
}
function init() {
var _local3 = random(_totalframes) + 1;
gotoAndStop(_local3);
if (_local3 < badFrame) {
objectType = 1;
score = 20;
} else {
objectType = 0;
score = -100;
}
addListener(_root.OG);
addListener(_root.GC);
setBoundary();
setAngle();
setStep();
onEnterFrame = doSomething;
onPress = pressed;
}
function pressed() {
angle = 90;
setStep();
}
function doSomething() {
_x = _x + xstep;
_y = _y + ystep;
if (_y > ymax) {
destroy();
}
checkPosition();
}
function checkPosition() {
if (hitTest(_root.player.hitarea) && ((_x > (_root.player._x - (_root.player.hitarea._width / 2))) && (_x < (_root.player._x + (_root.player.hitarea._width / 2))))) {
_root.GC.showScore(this, objectType);
destroy();
}
}
function setAngle() {
if (_x < xmid) {
angle = 90 - (random(aoa) + 5);
} else {
angle = 90 + (random(aoa) + 5);
}
}
function setStep() {
xstep = speed * Math.cos((angle * Math.PI) / 180);
ystep = speed * Math.sin((angle * Math.PI) / 180);
}
function destroy() {
var _local2 = new Object();
_local2.target = this;
_local2.event = "destroy";
broadcastMessage("onDestroyObject", _local2);
}
function remove() {
removeMovieClip();
}
function setBoundary() {
var _local3 = _root.getBoundary();
xmin = _local3[0];
ymin = _local3[1];
xmax = _local3[2];
ymax = _local3[3];
xmid = ((xmax - xmin) / 2) + xmin;
}
}
Symbol 227 MovieClip [__Packages.com.interfuel.Clock] Frame 0
class com.interfuel.Clock extends MovieClip
{
var clockTime, step, hand;
function Clock () {
super();
clockTime = 90;
step = 360 / clockTime;
}
function startClock() {
trace("startClock");
_root.clockInterval = setInterval(_root.frame_mc.clock_mc.run, 1000);
}
function run() {
_root.frame_mc.clock_mc.hand._rotation = _root.frame_mc.clock_mc.hand._rotation + _root.frame_mc.clock_mc.step;
}
function stopClock() {
clearInterval(_root.clockInterval);
}
function resetClock() {
hand._rotation = 0;
}
}
Symbol 35 Button
on (press) {
gotoAndStop (8);
}
Symbol 38 Button
on (release) {
nextFrame();
}
Symbol 45 Button
on (release) {
nextFrame();
}
Symbol 71 Button
on (release) {
prevFrame();
}
Symbol 169 MovieClip Frame 1
var percent = ((_width / 2) / _root.GC.maxScore);
_root.GC.addListener(this);
this.onScore = function (event) {
var _local1 = event.score;
if (_local1 < 0) {
marker._x = Math.max(marker._x + (_local1 * percent), -210);
} else {
marker._x = Math.min(marker._x + (_local1 * percent), 210);
}
};
Symbol 174 MovieClip [clock] Frame 1
#initclip 10
Object.registerClass("clock", com.interfuel.Clock);
#endinitclip
Symbol 179 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 1
sound_btn.onPress = function () {
if (this._currentframe == 1) {
sound_loop.gotoAndStop(2);
this.gotoAndStop(2);
} else {
sound_loop.gotoAndStop(1);
this.gotoAndStop(1);
}
};
pause_btn.onPress = function () {
if (this._currentframe == 1) {
sound_loop.gotoAndStop(2);
this.gotoAndStop(2);
} else {
sound_loop.gotoAndStop(1);
this.gotoAndStop(1);
}
};
Symbol 192 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 15
gotoAndStop (1);
Symbol 201 MovieClip Frame 1
frameLabel = "playFrame";
Symbol 201 MovieClip Frame 12
gotoAndPlay (1);
Symbol 201 MovieClip Frame 13
frameLabel = "stopFrame";
Symbol 203 MovieClip [player_mc] Frame 1
#initclip 8
Object.registerClass("player_mc", com.interfuel.Player);
#endinitclip
stop();
Symbol 206 MovieClip [falling_objects] Frame 1
#initclip 9
Object.registerClass("falling_objects", com.interfuel.FallingObject);
#endinitclip
stop();
Symbol 217 MovieClip Frame 1
stop();
Symbol 221 Button
on (press) {
gotoAndStop (8);
}