Instance of Symbol 85 MovieClip [Player] "player" in Frame 1
onClipEvent (load) {
var ground = _root.ground;
var grav = 2;
var gravity = 6;
var speed = 4;
var maxJump = -50;
var touchingGround = false;
}
onClipEvent (enterFrame) {
_y = (_y + grav);
grav = grav + gravity;
while (ground.hitTest(_x, _y, true)) {
_y = (_y - gravity);
grav = 0;
}
if (ground.hitTest(_x, _y + 5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (Key.isDown(39)) {
_x = (_x + speed);
}
if (Key.isDown(37)) {
_x = (_x - speed);
}
if (Key.isDown(38) && (touchingGround)) {
grav = maxJump;
}
if (ground.hitTest(_x + (_width / 2), _y - (_height / 2), true)) {
_x = (_x - speed);
}
if (ground.hitTest(_x - (_width / 2), _y - (_height / 2), true)) {
_x = (_x + speed);
}
if (ground.hitTest(_x, _y - height, true)) {
grav = 3;
}
}
Symbol 8 MovieClip [Explosion] Frame 1
#initclip 38
Object.registerClass("Explosion", Explosion);
#endinitclip
Symbol 8 MovieClip [Explosion] Frame 10
this.removeMovieClip;
Symbol 8 MovieClip [Explosion] Frame 15
stop();
Symbol 10 MovieClip [Rainbow] Frame 1
#initclip 20
Object.registerClass("Rainbow", Rainbow);
#endinitclip
Symbol 19 MovieClip [Crocodile] Frame 1
#initclip 21
Object.registerClass("Crocodile", Crocodile);
#endinitclip
Symbol 19 MovieClip [Crocodile] Frame 8
gotoAndPlay (1);
Symbol 22 MovieClip [EnemyCrow] Frame 1
#initclip 22
Object.registerClass("EnemyCrow", EnemyCrow);
#endinitclip
Symbol 25 MovieClip [smallBadge] Frame 1
#initclip 23
Object.registerClass("smallBadge", smallBadge);
#endinitclip
Symbol 28 MovieClip [pointText2] Frame 1
#initclip 24
Object.registerClass("pointText2", pointText2);
#endinitclip
Symbol 28 MovieClip [pointText2] Frame 21
stop();
Symbol 30 MovieClip [pointText3] Frame 1
#initclip 25
Object.registerClass("pointText3", pointText3);
#endinitclip
Symbol 30 MovieClip [pointText3] Frame 21
stop();
Symbol 33 MovieClip [pointText4] Frame 1
#initclip 26
Object.registerClass("pointText4", pointText4);
#endinitclip
Symbol 33 MovieClip [pointText4] Frame 21
stop();
Symbol 35 MovieClip [pointText] Frame 1
#initclip 27
Object.registerClass("pointText", pointText);
#endinitclip
Symbol 35 MovieClip [pointText] Frame 21
stop();
Symbol 38 MovieClip [smallBadge2] Frame 1
#initclip 28
Object.registerClass("smallBadge2", smallBadge2);
#endinitclip
Symbol 41 MovieClip [smallBadge3] Frame 1
#initclip 29
Object.registerClass("smallBadge3", smallBadge3);
#endinitclip
Symbol 44 MovieClip [smallBadge4] Frame 1
#initclip 30
Object.registerClass("smallBadge4", smallBadge4);
#endinitclip
Symbol 58 MovieClip [crystalSpike] Frame 1
#initclip 31
Object.registerClass("crystalSpike", crystalSpike);
#endinitclip
Symbol 58 MovieClip [crystalSpike] Frame 20
gotoAndPlay (1);
Symbol 58 MovieClip [crystalSpike] Frame 21
gotoAndPlay (1);
Symbol 58 MovieClip [crystalSpike] Frame 22
stop();
Symbol 63 MovieClip [lightningCloud] Frame 1
#initclip 32
Object.registerClass("lightningCloud", lightningCloud);
#endinitclip
Symbol 67 MovieClip [Lightning] Frame 1
#initclip 33
Object.registerClass("Lightning", Lightning);
#endinitclip
Symbol 67 MovieClip [Lightning] Frame 40
stop();
this.removeMovieClip();
Symbol 70 MovieClip [Apple] Frame 1
#initclip 34
Object.registerClass("Apple", Apple);
#endinitclip
Symbol 73 MovieClip [healthText] Frame 1
#initclip 35
Object.registerClass("healthText", healthText);
#endinitclip
Symbol 73 MovieClip [healthText] Frame 21
stop();
this.removeMovieClip();
Symbol 85 MovieClip [Player] Frame 1
#initclip 36
Object.registerClass("Player", Player);
#endinitclip
Symbol 85 MovieClip [Player] Frame 17
gotoAndPlay (1);
Symbol 88 MovieClip [BackgroundCloudMovieClip] Frame 1
#initclip 37
Object.registerClass("BackgroundCloudMovieClip", BackgroundCloudMovieClip);
#endinitclip
Symbol 155 Button
on (release) {
sound.setVolume(0);
gotoAndStop (2);
}
Symbol 158 Button
on (release) {
sound.setVolume(100);
gotoAndStop (1);
}
Symbol 159 MovieClip Frame 1
stop();
sound = new Sound();
Symbol 163 MovieClip [__Packages.Rainbow] Frame 0
class Rainbow extends MovieClip
{
var _x, _y, speed, removeMovieClip, hitTest;
function Rainbow () {
super();
}
function onLoad() {
_x = 700;
_y = 429 - (Math.random() * 0.5);
speed = 30;
}
function onEnterFrame() {
_x = _x - speed;
if (_x < 500) {
removeMovieClip();
}
if (hitTest(_root.player)) {
_root.player._y = _root.player._y - 1;
}
}
}
Symbol 164 MovieClip [__Packages.Crocodile] Frame 0
class Crocodile extends MovieClip
{
var _y, _x, speed, removeMovieClip, hitTest;
function Crocodile () {
super();
}
function onLoad() {
_y = 413;
_x = -300;
speed = (Math.random() * 1) + 3;
}
function onEnterFrame() {
_x = _x + speed;
if (_x > 700) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateHealth(-15);
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 165 MovieClip [__Packages.EnemyCrow] Frame 0
class EnemyCrow extends MovieClip
{
var _y, _x, speed, removeMovieClip, hitTest;
function EnemyCrow () {
super();
}
function onLoad() {
_y = 110;
_x = -300;
speed = (Math.random() * 3) + 5;
}
function onEnterFrame() {
_x = _x + speed;
if (_x > 700) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateHealth(-20);
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 166 MovieClip [__Packages.smallBadge] Frame 0
class smallBadge extends MovieClip
{
var speed, _x, _y, pointitem, removeMovieClip, hitTest;
function smallBadge () {
super();
}
function onLoad() {
speed = 4;
_x = 650 + random(1000);
_y = 420 - random(280);
pointitem = [];
}
function onEnterFrame() {
_x = _x - speed;
if (_x < -50) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateScore(1);
_root.player.updateBadges(1);
var _local3 = _root.attachMovie("pointText", "pointText" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function takeDamage() {
_x = -100;
}
}
Symbol 167 MovieClip [__Packages.pointText2] Frame 0
class pointText2 extends MovieClip
{
var _x, _y;
function pointText2 () {
super();
}
function onLoad() {
_x = 485;
_y = 30;
}
}
Symbol 168 MovieClip [__Packages.pointText3] Frame 0
class pointText3 extends MovieClip
{
var _x, _y;
function pointText3 () {
super();
}
function onLoad() {
_x = 440;
_y = 15;
}
}
Symbol 169 MovieClip [__Packages.pointText4] Frame 0
class pointText4 extends MovieClip
{
var _x, _y;
function pointText4 () {
super();
}
function onLoad() {
_x = 0;
_y = 220;
}
}
Symbol 170 MovieClip [__Packages.pointText] Frame 0
class pointText extends MovieClip
{
var _x, _y;
function pointText () {
super();
}
function onLoad() {
_x = 540;
_y = 30;
}
}
Symbol 171 MovieClip [__Packages.smallBadge2] Frame 0
class smallBadge2 extends MovieClip
{
var speed, _x, _y, pointitem, removeMovieClip, hitTest;
function smallBadge2 () {
super();
}
function onLoad() {
speed = 4;
_x = 1000 + random(2000);
_y = 420 - random(267);
pointitem = [];
}
function onEnterFrame() {
_x = _x - speed;
if (_x < -50) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateScore(20);
_root.player.updateBadges(1);
var _local3 = _root.attachMovie("pointText2", "pointText2" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function takeDamage() {
_x = -100;
}
}
Symbol 172 MovieClip [__Packages.smallBadge3] Frame 0
class smallBadge3 extends MovieClip
{
var speed, _x, _y, pointitem, removeMovieClip, hitTest;
function smallBadge3 () {
super();
}
function onLoad() {
speed = 4;
_x = 1750 + random(5000);
_y = 420 - random(265);
pointitem = [];
}
function onEnterFrame() {
_x = _x - speed;
if (_x < -50) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateScore(75);
_root.player.updateBadges(1);
var _local3 = _root.attachMovie("pointText3", "pointText3" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function takeDamage() {
_x = -100;
}
}
Symbol 173 MovieClip [__Packages.smallBadge4] Frame 0
class smallBadge4 extends MovieClip
{
var speed, _x, _y, pointitem, removeMovieClip, hitTest;
function smallBadge4 () {
super();
}
function onLoad() {
speed = 4;
_x = 5000 + random(10000);
_y = 420 - random(255);
pointitem = [];
}
function onEnterFrame() {
_x = _x - speed;
if (_x < -50) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateScore(2000);
_root.player.updateBadges(1);
var _local3 = _root.attachMovie("pointText4", "pointText4" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function takeDamage() {
_x = -100;
}
}
Symbol 174 MovieClip [__Packages.crystalSpike] Frame 0
class crystalSpike extends MovieClip
{
var _y, _x, speed, removeMovieClip, hitTest;
function crystalSpike () {
super();
}
function onLoad() {
_y = 431.9;
_x = 674.3;
speed = (Math.random() * 3) + 5;
}
function onEnterFrame() {
_x = _x - speed;
if (_x < -26.7) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateHealth(-10);
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 175 MovieClip [__Packages.lightningCloud] Frame 0
class lightningCloud extends MovieClip
{
var _y, _x, speed, shootTimer, removeMovieClip;
function lightningCloud () {
super();
}
function onLoad() {
_y = 90;
_x = -300;
speed = (Math.random() * 3) + 5;
shootTimer = 0;
}
function onEnterFrame() {
_x = _x + speed;
if (_x > 700) {
removeMovieClip();
}
shootTimer = shootTimer + 1;
if (shootTimer > 30) {
shootTimer = 0;
var _local3 = _root.attachMovie("Lightning", "Lightning" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 5;
_local3._x = _x + 2;
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 176 MovieClip [__Packages.Lightning] Frame 0
class Lightning extends MovieClip
{
var speed, _y, hitTest, removeMovieClip, _x;
function Lightning () {
super();
}
function onLoad() {
speed = -15;
}
function onEnterFrame() {
_y = _y - speed;
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateHealth(-30);
}
if (hitTest(_root.shipskin.body)) {
_root.ship.updateScore(3);
_root.ship.updateGraze(2);
}
if (_y > 620) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 177 MovieClip [__Packages.Apple] Frame 0
class Apple extends MovieClip
{
var speed, _x, _y, pointitem, removeMovieClip, hitTest;
function Apple () {
super();
}
function onLoad() {
speed = 4;
_x = -30;
_y = 420 - random(300);
pointitem = [];
}
function onEnterFrame() {
_x = _x + speed;
if (_x > 665.9) {
removeMovieClip();
}
if (hitTest(_root.player)) {
removeMovieClip();
_root.player.updateHealth(100);
var _local3 = _root.attachMovie("healthText", "healthText" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
if (_root.player.health < 1) {
removeMovieClip();
}
}
}
Symbol 178 MovieClip [__Packages.healthText] Frame 0
class healthText extends MovieClip
{
var _x, _y;
function healthText () {
super();
}
function onLoad() {
_x = 325;
_y = 250;
}
}
Symbol 179 MovieClip [__Packages.Player] Frame 0
class Player extends MovieClip
{
var diff, speed, rainbows, badgeitem, apple, enemies, enemyTimer, crowTimer, cloudTimer, crystalTimer, jumpTime, score, badges, smallbadge, gameTime, itemTimer, itemTimer2, itemTimer3, itemTimer4, appleTimer, paraspriteTimer, _visible, _y, _x, health, finalScore;
function Player () {
super();
}
function onLoad() {
_root.kongregateServices.connect();
_root.backgroundMusic = new Sound();
_root.backgroundMusic.attachSound("CutieMarkCrusadersTheme8Bit.mp3");
_root.backgroundMusic.start(0, 1000);
diff = 1;
speed = 10;
rainbows = [];
badgeitem = [];
apple = [];
enemies = [];
enemyTimer = 0;
crowTimer = 0;
cloudTimer = 0;
crystalTimer = 0;
jumpTime = 0;
score = 0;
badges = 0;
smallbadge = [];
resetScore();
resetHealth();
gameTime = 0;
itemTimer = 0;
itemTimer2 = 0;
itemTimer3 = 0;
itemTimer4 = 0;
appleTimer = 0;
paraspriteTimer = 0;
_visible = false;
_root.gameOverMenu._visible = false;
_root.gameStartMenu.StartNowButton.onPress = function () {
_root.player.newGame();
};
}
function onEnterFrame() {
if (_visible == true) {
_y = _y + 1;
if (Key.isDown(68)) {
_x = _x + speed;
}
if (Key.isDown(65)) {
_x = _x - speed;
}
if (Key.isDown(32)) {
speed = 20;
} else {
speed = 10;
}
if (_x > 650) {
_root.player._x = _root.player._x - speed;
}
if (_x < 40) {
_root.player._x = _root.player._x + speed;
}
if (_y < 0) {
_root.player._y = 422;
}
gameTime = gameTime + 1;
if (gameTime > 1000) {
diff = 1.25;
}
if (gameTime > 3000) {
diff = 1.5;
}
if (gameTime > 5000) {
diff = 2;
}
if (gameTime > 10000) {
diff = 2.5;
}
if (gameTime > 20000) {
diff = 3;
}
if (gameTime > 100000) {
diff = 5;
}
itemTimer = itemTimer + (1 + (diff * 1));
if (itemTimer > 50) {
itemTimer = 0;
var _local5 = _root.attachMovie("smallBadge", "smallBadge" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5.push(_local5);
}
itemTimer2 = itemTimer2 + (1 + (diff * 1));
if (itemTimer2 > 100) {
itemTimer2 = 0;
var _local5 = _root.attachMovie("smallBadge2", "smallBadge2" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5.push(_local5);
}
itemTimer3 = itemTimer3 + (1 + (diff * 1));
if (itemTimer3 > 750) {
itemTimer3 = 0;
var _local5 = _root.attachMovie("smallBadge3", "smallBadge3" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5.push(_local5);
}
itemTimer4 = itemTimer4 + (1 + (diff * 1));
if (itemTimer4 > 1000) {
itemTimer4 = 0;
var _local5 = _root.attachMovie("smallBadge4", "smallBadge34" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5.push(_local5);
}
appleTimer = appleTimer + (1 + (diff * 1));
if (appleTimer > 3000) {
appleTimer = 0;
var _local4 = _root.attachMovie("Apple", "Apple" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4.push(_local4);
}
if (gameTime > 200) {
enemyTimer = enemyTimer + (1 + (diff * 1));
}
if (enemyTimer > 210) {
enemyTimer = 0;
var _local3 = _root.attachMovie("Crocodile", "Crocodile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3.push(_local3);
}
if (gameTime > 600) {
crowTimer = crowTimer + (1 + (diff * 1));
}
if (crowTimer > 500) {
crowTimer = 0;
var _local3 = _root.attachMovie("EnemyCrow", "EnemyCrow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3.push(_local3);
}
crystalTimer = crystalTimer + (1 + (diff * 1));
if (crystalTimer > 150) {
crystalTimer = 0;
var _local3 = _root.attachMovie("crystalSpike", "crystalSpike" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3.push(_local3);
}
if (gameTime > 1500) {
cloudTimer = cloudTimer + (1 + (diff * 1));
}
if (cloudTimer > 800) {
cloudTimer = 0;
var _local3 = _root.attachMovie("lightningCloud", "lightningCloud" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3.push(_local3);
}
}
}
function newGame() {
_visible = true;
_root.sun._x = 350;
_root.healthMeter._x = 15;
_root.healthMeter._y = 25;
_root.MuteBox._x = 1000;
_root.MuteBox._y = 313.1;
_root.scoreText.visible = true;
_y = 300;
_x = 250;
_root.gameOverMenu._visible = false;
_root.gameStartMenu._visible = false;
resetHealth();
resetScore();
(resetBadges);// not popped
enemyTimer = 0;
crowTimer = 0;
cloudTimer = 0;
crystalTimer = 0;
paraspriteTimer = 0;
jumpTime = 0;
score = 0;
gameTime = 0;
itemTimer = 0;
itemTimer2 = 0;
itemTimer3 = 0;
itemTimer4 = 0;
appleTimer = 0;
diff = 0;
}
function resetHealth() {
health = 100;
_root.healthMeter.bar._xscale = 100;
}
function updateHealth(points) {
health = health + points;
if (health < 1) {
health = 0;
_root.gameOverMenu._visible = true;
explode();
}
if (health > 100) {
health = 100;
}
_root.healthMeter.bar._xscale = health;
}
function explode() {
_visible = false;
var _local4 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
for (var _local3 in enemies) {
enemies[_local3].explode();
}
gameOver();
_root.kongregateScores.submit("score", score);
_root.kongregateScores.submit("badges", badges);
}
function updateScore(points) {
score = score + points;
_root.scoreText.text = score;
}
function resetScore() {
score = 0;
_root.scoreText.text = score;
}
function updateBadges(points) {
badges = badges + points;
_root.badgesText.text = badges;
}
function resetBadges() {
badges = 0;
_root.scoreBadges.text = badges;
}
function gameOver() {
_root.gameOverMenu._visible = true;
_root.MuteBox._x = 239.8;
_root.MuteBox._y = 313.1;
_root.gameOverMenu.playAgainButton.onPress = function () {
_root.player.newGame();
};
_root.gameOverMenu.scoreText.text = score;
_root.gameOverMenu.badgeBonus.text = badges;
finalScore = score + (badges * 10);
_root.gameOverMenu.finalScore.text = finalScore;
_root.kongregateStats.submit("HighScore", finalScore);
_root.kongregateStats.submit("badges", badges);
}
}
Symbol 180 MovieClip [__Packages.BackgroundCloudMovieClip] Frame 0
class BackgroundCloudMovieClip extends MovieClip
{
var speed, _y, _x;
function BackgroundCloudMovieClip () {
super();
}
function onLoad() {
speed = 1.5 + random(2.5);
_y = random(450);
}
function onEnterFrame() {
_x = _x - speed;
if (_x < -5) {
_x = 682;
_y = random(450);
}
}
}
Symbol 181 MovieClip [__Packages.Explosion] Frame 0
class Explosion extends MovieClip
{
function Explosion () {
super();
}
}