Combined Code
movieClip 4 {
}
button 8 {
on (release) {
_root.play();
}
}
movieClip 9 {
frame 1 {
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
eval(loading_bar)._xscale = PercentLoaded;
} else {
gotoAndStop(3);
}
}
frame 2 {
gotoAndPlay(1);
}
}
movieClip 16 {
frame 1 {
stop();
}
frame 2 {
}
frame 8 {
gotoAndStop(1);
}
}
instance mouse_mc of movieClip 16 {
onClipEvent (load) {
startDrag('', true);
}
onClipEvent (enterFrame) {
_root.xvalue = _root._xmouse;
this._x = _root.xvalue;
}
onClipEvent (enterFrame) {
_root.yvalue = _root._ymouse;
this._y = _root.yvalue;
}
onClipEvent (enterFrame) {
_root.xytotal = _root.yvalue + _root.xvalue;
}
}
// unknown tag 88 length 69
frame 2 {
stop();
}
movieClip 22 {
}
movieClip 24 {
}
instance pika of movieClip 24 {
onClipEvent (load) {
movespeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
play();
_rotation = 90;
_x = _x + movespeed;
}
if (Key.isDown(37)) {
play();
_rotation = 270;
_x = _x - movespeed;
}
if (Key.isDown(38)) {
play();
_rotation = 0;
_y = _y - movespeed;
}
if (Key.isDown(40)) {
play();
_rotation = 180;
_y = _y + movespeed;
}
if (Key.isDown(39) && Key.isDown(38)) {
_rotation = 45;
}
if (Key.isDown(37) && Key.isDown(38)) {
_rotation = 315;
}
if (Key.isDown(39) && Key.isDown(40)) {
_rotation = 135;
}
if (Key.isDown(37) && Key.isDown(40)) {
_rotation = 225;
}
}
}
movieClip 38 {
frame 1 {
stop();
}
frame 3 {
gotoAndStop(1);
}
frame 10 {
gotoAndStop(1);
}
frame 16 {
gotoAndStop(1);
}
}
instance pikabody of movieClip 38 {
onClipEvent (load) {
movespeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
play();
_rotation = 90;
_x = _x + movespeed;
}
if (Key.isDown(65)) {
play();
_rotation = 270;
_x = _x - movespeed;
}
if (Key.isDown(87)) {
play();
_rotation = 0;
_y = _y - movespeed;
}
if (Key.isDown(83)) {
play();
_rotation = 180;
_y = _y + movespeed;
}
if (Key.isDown(68) && Key.isDown(87)) {
_rotation = 45;
}
if (Key.isDown(65) && Key.isDown(87)) {
_rotation = 315;
}
if (Key.isDown(68) && Key.isDown(83)) {
_rotation = 135;
}
if (Key.isDown(65) && Key.isDown(83)) {
_rotation = 225;
}
}
}
button 41 {
on (release) {
if (toggle1 == 1) {
_root.checkEnergy();
} else {
if (toggle2 == 1) {
_root.headButt();
}
}
}
}
movieClip 46 {
}
movieClip 48 {
instance bar_mc of movieClip 46 {
onClipEvent (enterFrame) {
this._xscale = _root.health;
}
}
}
movieClip 52 {
}
movieClip 53 {
instance bar_mc of movieClip 52 {
onClipEvent (enterFrame) {
this._xscale = _root.energy;
}
}
}
movieClip 56 {
frame 32 {
_root.regenEnergy();
gotoAndPlay(1);
}
}
button 57 {
on (release) {
regenEnergy();
}
}
movieClip 59 {
frame 1 {
stop();
}
frame 8 {
gotoAndStop(1);
}
}
button 65 {
on (keyPress '1') {
if (_root.toggle1 == 0) {
toggle1 = 1;
toggle2 = 0;
_root.select1_mc.gotoAndStop(3);
_root.select2_mc.gotoAndStop(2);
} else {
toggle1 = 0;
_root.select1_mc.gotoAndStop(2);
_root.select2_mc.gotoAndStop(2);
}
}
}
movieClip 68 {
frame 2 {
stop();
}
}
button 77 {
on (keyPress '2') {
if (_root.toggle2 == 0) {
toggle2 = 1;
toggle1 = 0;
_root.select2_mc.gotoAndStop(3);
_root.select1_mc.gotoAndStop(2);
} else {
toggle2 = 0;
_root.select2_mc.gotoAndStop(2);
_root.select1_mc.gotoAndStop(2);
}
}
}
movieClip 78 {
frame 2 {
stop();
}
}
button 81 {
on (release) {
play();
}
}
frame 9 {
stop();
}
frame 17 {
stop();
}
frame 24 {
stop();
}
instance map_mc of movieClip 22 {
onClipEvent (load) {
movespeed = 14;
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
_x = _x - movespeed;
}
if (Key.isDown(65)) {
_x = _x + movespeed;
}
if (Key.isDown(87)) {
_y = _y + movespeed;
}
if (Key.isDown(83)) {
_y = _y - movespeed;
}
}
}
instance pika of movieClip 24 {
onClipEvent (load) {
movespeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
play();
_rotation = 90;
_x = _x + movespeed;
}
if (Key.isDown(37)) {
play();
_rotation = 270;
_x = _x - movespeed;
}
if (Key.isDown(38)) {
play();
_rotation = 0;
_y = _y - movespeed;
}
if (Key.isDown(40)) {
play();
_rotation = 180;
_y = _y + movespeed;
}
if (Key.isDown(39) && Key.isDown(38)) {
_rotation = 45;
}
if (Key.isDown(37) && Key.isDown(38)) {
_rotation = 315;
}
if (Key.isDown(39) && Key.isDown(40)) {
_rotation = 135;
}
if (Key.isDown(37) && Key.isDown(40)) {
_rotation = 225;
}
}
}
instance pikabody of movieClip 38 {
onClipEvent (load) {
movespeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
play();
_rotation = 90;
_x = _x + movespeed;
}
if (Key.isDown(65)) {
play();
_rotation = 270;
_x = _x - movespeed;
}
if (Key.isDown(87)) {
play();
_rotation = 0;
_y = _y - movespeed;
}
if (Key.isDown(83)) {
play();
_rotation = 180;
_y = _y + movespeed;
}
if (Key.isDown(68) && Key.isDown(87)) {
_rotation = 45;
}
if (Key.isDown(65) && Key.isDown(87)) {
_rotation = 315;
}
if (Key.isDown(68) && Key.isDown(83)) {
_rotation = 135;
}
if (Key.isDown(65) && Key.isDown(83)) {
_rotation = 225;
}
}
}
movieClip 88 {
}
instance brick_W_mc of movieClip 88 {
onClipEvent (load) {
movespeed = 14;
ss = 14;
}
onClipEvent (enterFrame) {
if (_parent.pika.hitTest(this)) {
_root.map_mc._x -= ss;
_root.brick_N_mc._x -= ss;
_root.brick_E_mc._x -= ss;
_root.brick_W_mc._x -= ss;
_root.brick_S_mc._x -= ss;
_root.brick_NW_mc._x -= ss;
_root.apple_mc._x -= ss;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
_x = _x - movespeed;
}
if (Key.isDown(65)) {
_x = _x + movespeed;
}
if (Key.isDown(87)) {
_y = _y + movespeed;
}
if (Key.isDown(83)) {
_y = _y - movespeed;
}
}
}
instance brick_N_mc of movieClip 88 {
onClipEvent (load) {
movespeed = 14;
ss = 14;
}
onClipEvent (enterFrame) {
if (_parent.pika.hitTest(this)) {
_root.map_mc._y -= ss;
_root.brick_N_mc._y -= ss;
_root.brick_E_mc._y -= ss;
_root.brick_W_mc._y -= ss;
_root.brick_S_mc._y -= ss;
_root.brick_NW_mc._y -= ss;
_root.apple_mc._y -= ss;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
_x = _x - movespeed;
}
if (Key.isDown(65)) {
_x = _x + movespeed;
}
if (Key.isDown(87)) {
_y = _y + movespeed;
}
if (Key.isDown(83)) {
_y = _y - movespeed;
}
}
}
instance brick_E_mc of movieClip 88 {
onClipEvent (load) {
movespeed = 14;
ss = 14;
}
onClipEvent (enterFrame) {
if (_parent.pika.hitTest(this)) {
_root.map_mc._x += ss;
_root.brick_N_mc._x += ss;
_root.brick_E_mc._x += ss;
_root.brick_W_mc._x += ss;
_root.brick_S_mc._x += ss;
_root.brick_NW_mc._x += ss;
_root.apple_mc._x += ss;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
_x = _x - movespeed;
}
if (Key.isDown(65)) {
_x = _x + movespeed;
}
if (Key.isDown(87)) {
_y = _y + movespeed;
}
if (Key.isDown(83)) {
_y = _y - movespeed;
}
}
}
instance brick_S_mc of movieClip 88 {
onClipEvent (load) {
movespeed = 14;
ss = 14;
}
onClipEvent (enterFrame) {
if (_parent.pika.hitTest(this)) {
_root.map_mc._y += ss;
_root.brick_N_mc._y += ss;
_root.brick_E_mc._y += ss;
_root.brick_W_mc._y += ss;
_root.brick_S_mc._y += ss;
_root.brick_NW_mc._y += ss;
_root.apple_mc._y += ss;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
_x = _x - movespeed;
}
if (Key.isDown(65)) {
_x = _x + movespeed;
}
if (Key.isDown(87)) {
_y = _y + movespeed;
}
if (Key.isDown(83)) {
_y = _y - movespeed;
}
}
}
button 98 {
on (release, keyPress '<Space>') {
play();
}
}
movieClip 99 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
}
frame 10 {
_root.apple_mc.play();
}
frame 11 {
stop();
}
}
instance brick_NW_mc of movieClip 99 {
onClipEvent (load) {
movespeed = 14;
}
onClipEvent (enterFrame) {
if (_parent.pika.hitTest(this) && Key.isDown(32)) {
_root.ChestCheck();
}
}
onClipEvent (enterFrame) {
if (Key.isDown(68)) {
_x = _x - movespeed;
}
if (Key.isDown(65)) {
_x = _x + movespeed;
}
if (Key.isDown(87)) {
_y = _y + movespeed;
}
if (Key.isDown(83)) {
_y = _y - movespeed;
}
}
}
frame 30 {
function addApples() {
apples += 1;
_root.showApples = apples;
}
function displayHealth() {
_root.showHealth = health;
}
function healthHeal() {
health += 10;
if (health > 100) {
health = 100;
}
displayHealth();
}
function healthDamage() {
health -= 10;
if (health < 0) {
health = 0;
}
displayHealth();
}
function displayEnergy() {
_root.showEnergy = energy;
}
function regenEnergy() {
energy += 10;
if (energy > 100) {
energy = 100;
}
_root.showEnergy = energy;
}
function lightningStrike() {
energy -= 10;
if (energy < 0) {
energy = 0;
}
displayEnergy();
}
function checkEnergy() {
if (energy >= 10) {
lightningStrike();
_root.pikaStatic_mc.gotoAndPlay(2);
_root.mouse_mc.gotoAndPlay(2);
_root.pikabody.gotoAndPlay(11);
}
}
function headButt() {
if (energy >= 5) {
if (_root.xvalue > 230 && _root.xvalue < 330 && _root.yvalue < 220) {
_root.pikabody._rotation = 0;
}
if (_root.xvalue > 230 && _root.xvalue < 330 && _root.yvalue > 220) {
_root.pikabody._rotation = 180;
}
if (_root.xvalue < 280 && _root.yvalue > 170 && _root.yvalue < 270) {
_root.pikabody._rotation = 270;
}
if (_root.xvalue > 280 && _root.yvalue > 170 && _root.yvalue < 270) {
_root.pikabody._rotation = 90;
}
if (_root.xvalue < 230 && _root.yvalue < 170) {
_root.pikabody._rotation = 315;
}
if (_root.xvalue > 330 && _root.yvalue < 170) {
_root.pikabody._rotation = 45;
}
if (_root.xvalue > 330 && _root.yvalue > 280) {
_root.pikabody._rotation = 135;
}
if (_root.xvalue < 230 && _root.yvalue > 280) {
_root.pikabody._rotation = 225;
}
energy -= 5;
displayEnergy();
_root.pikabody.gotoAndPlay(5);
}
}
function ChestCheck() {
if (ChestStatus == closed) {
_root.ChestStatus = opened;
_root.brick_NW_mc.gotoAndPlay(3);
}
if (ChestStatus == opened) {
_root.brick_NW_mc.gotoAndStop(11);
}
}
var apples = 0;
var headbutt = stoppd;
var ChestStatus = closed;
var toggle1 = 0;
var toggle2 = 0;
var spaceBar = 0;
var health = 100;
var energy = 50;
displayHealth();
displayEnergy();
checkRegen();
stop();
}