Frame 1
total_bytes = this.getBytesTotal();
loaded_bytes = this.getBytesLoaded();
remaining_bytes = total_bytes - loaded_bytes;
percent_done = int((loaded_bytes / total_bytes) * 100);
this.bomby.gotoAndPlay(Math.floor(percent_done / 2));
perDone = percent_done;
if (percent_done > 99) {
gotoAndPlay (5);
}
Frame 2
gotoAndPlay (1);
Frame 3
function sitelock(urls_allowed) {
lock = true;
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain.text = real_domain[0];
for (x in urls_allowed) {
if (urls_allowed[x] == real_domain[0]) {
lock = false;
gotoAndPlay (3);
}
}
if (lock) {
}
}
urls_allowed = ["www.kingbaggot.com", "www.flashgamelicense.com"];
sitelock(urls_allowed);
stop();
Frame 5
function startgame() {
dragArray = new Array();
spineArray = new Array();
spineArray = [10, 14, 15, 10];
begin();
gstate = 0;
dragSize = 31;
dragSize = 31;
level = 1;
lives = 3;
initSounds();
warning.swapDepths(8001);
}
function begin() {
}
function clickup() {
clicked = 0;
if ((rider._currentframe > 26) and (rider._currentframe < 70)) {
rider.gotoAndPlay("still");
}
}
function clickdown() {
clicked = 1;
}
function game() {
tx = _root._xmouse;
ty = _root._ymouse;
if (gstate == 0) {
warning._visible = false;
deathCounter = 0;
GUI.dragSize = dragSize;
rider._y = 1374;
rider._xscale = 100;
rider._yscale = 100;
rider._rotation = 0;
wind._visible = false;
bg.gotoAndStop(1);
if (GUI._currentframe == 63) {
if (dragSize == 31) {
sndWind.stop("s_wind");
sndMusic.start(0, 1000);
}
warning._visible = true;
initBG();
makeDragCode();
makeDrag();
wind._visible = true;
wind._alpha = 100;
gstate = 1;
}
}
if (gstate == 1) {
moveSplat();
deathCounter = deathCounter - 1;
if ((camy > -151) or ((clicked == 1) and (camy > (-80 * (dragSize - 8))))) {
camy = camy - 8;
rider._x = 200;
if (rider._currentframe < 26) {
rider.gotoAndPlay("run");
}
if ((camy == -151) and (rider._y > 400)) {
rider._y = 374;
rider.gotoAndPlay("land");
warning._visible = false;
}
}
riderStuff();
moveDrag();
redrawBG();
}
if (gstate == 2) {
moveSplat();
rider._rotation = rider._rotation - (5 * (lives + 1));
if (((rider._xscale > 0) and (lives > 0)) or ((rider._xscale > 0) and (rider._y > 400))) {
rider._xscale = rider._xscale - 2;
rider._yscale = rider._yscale - 2;
}
if ((rider._xscale > 0) and (lives == 0)) {
rider._y = rider._y + 1;
}
camy = camy + 16;
moveDrag();
redrawBG();
if (rider._xscale == 2) {
bg.gotoAndPlay(2);
}
if (rider._xscale == 0) {
wind._alpha = wind._alpha - 5;
}
if ((bg._currentframe == 20) and (GUI._currentframe == 63)) {
GUI.gotoAndPlay("gameOver");
}
GUI.againBut.onRelease = function () {
if (camy > 640) {
dragSize = 31;
level = 1;
lives = 3;
GUI.gotoAndPlay(1);
gstate = 0;
sndMusic.stop("s_music1");
sndWind.start(0, 1000);
}
};
}
if (gstate == 3) {
if (rider._currentframe == 151) {
sndRoar.start();
makeSplat(rider._x, rider._y, 60, 45);
}
if (rider._currentframe > 151) {
moveSplat();
}
camy = camy - 1;
if (rider._currentframe == 154) {
camy = camy - 7;
}
if ((rider._y > 500) and (GUI._currentframe == 63)) {
GUI.gotoAndPlay("levelUp");
}
riderStuff();
moveDrag();
redrawBG();
GUI.againBut.onRelease = function () {
GUI.gotoAndPlay(131);
wind._visible = false;
dragSize = dragSize + 17;
level = level + 1;
gstate = 0;
};
}
}
function riderStuff() {
clip = _root.block6;
if (rider._currentframe < 100) {
rider._rotation = (-clip._rotation) + ((tx - 200) / 10);
rider._x = clip._x + ((tx - 200) / 2);
alive = 0;
clip = _root.block6;
clop = _root.block5;
if (clip.hitTest(rider._x, rider._y, true) or clop.hitTest(rider._x, rider._y, true)) {
alive = 1;
}
if ((alive == 0) and (rider._y < 600)) {
rider.swapDepths(1);
gstate = 2;
}
}
if (rider._currentframe > 116) {
rider._x = targetX;
rider._y = targetY + 30;
}
clip = _root["seg" + segy];
clop = _root.seg7;
wind._rotation = clip.rot - clop.rot;
}
function moveDrag() {
clip = _root.seg0;
xDif = clip._x - tx;
yDif = clip._y - ty;
hyp = Math.sqrt((xDif * xDif) + (yDif * yDif));
angle = 57.2957795130823 * Math.acos(yDif / hyp);
if (tx < clip._x) {
angle = Math.abs(angle - 360);
}
headDirMove = 2;
if (angle < clip.rot) {
headDirMove = -2;
}
if (Math.abs(angle - clip.rot) > 180) {
headDirMove = -headDirMove;
}
clip.rot = clip.rot + headDirMove;
if (clip.rot < 0) {
clip.rot = 360;
}
if (clip.rot > 360) {
clip.rot = 0;
}
rot = clip.rot * (Math.PI/180);
clip._x = clip._x + (headSpeed * Math.sin(rot));
clip._y = clip._y - (headSpeed * Math.cos(rot));
clip.typ = 0;
i = 1;
while (i < (dragSize + 1)) {
clip = _root["seg" + i];
clop = _root["seg" + (i - 1)];
aheadRot = _root["seg" + (i - 1)].rot;
newRot = ((180 + clip.rot) + ((aheadRot - clip.rot) / 5)) * (Math.PI/180);
clip._x = clop._x + (segWidth * Math.sin(newRot));
clip._y = clop._y - (segWidth * Math.cos(newRot));
clip.rot = (newRot / (Math.PI/180)) - 180;
clip.typ = i;
i++;
}
}
function makeDrag() {
i = 0;
while (i < (dragSize + 1)) {
attachMovie("seg", "seg" + i, 100 + i);
clip = _root["seg" + i];
clip._visible = false;
clip._x = 200;
clip._y = 200 + (i * 11);
clip.Mx = 0;
clip.My = 0;
clip.dx = 0;
clip.dy = 0;
clip.rot = 0;
i++;
}
segWidth = 10;
headDir = 0;
headDirMove = 2;
headSpeed = 2;
mag.x = 80;
mag.y = 80;
}
function redrawBG() {
segy = dragSize + Math.floor(camy / 80);
camDif = camy - (Math.floor(camy / 80) * 80);
if (segy < 1) {
segy = 1;
}
testText3 = camy;
topSeg = _root["seg" + (segy - 7)];
if ((segy - 7) < 0) {
topSeg = _root["seg" + (segy - 1)];
}
botSeg = _root["seg" + segy];
xDif = botSeg._x - topSeg._x;
yDif = botSeg._y - topSeg._y;
hyp = Math.sqrt((xDif * xDif) + (yDif * yDif));
angle1 = 57.2957795130823 * Math.acos(yDif / hyp);
if (topSeg._x < botSeg._x) {
angle1 = Math.abs(angle1 - 360);
}
topSeg = _root["seg" + (segy - 8)];
if ((segy - 8) < 0) {
topSeg = _root["seg" + (segy - 1)];
}
botSeg = _root["seg" + (segy - 1)];
xDif = botSeg._x - topSeg._x;
yDif = botSeg._y - topSeg._y;
hyp = Math.sqrt((xDif * xDif) + (yDif * yDif));
angle2 = 57.2957795130823 * Math.acos(yDif / hyp);
if (topSeg._x < botSeg._x) {
angle2 = Math.abs(angle2 - 360);
}
bgy = camy * 1;
bgdif = Math.floor(bgy / 80) + 0;
angle = angle1;
distAlong = ((bgdif * 80) - bgy) / 80;
angle = angle1 + ((angle2 - angle1) * distAlong);
testText = rider._y;
testText2 = segy;
var _local2 = 0;
while (_local2 < 7) {
clip = _root["block" + _local2];
clop = _root["seg" + ((segy - 7) + _local2)];
clip._y = (_local2 * 80) - (bgy - (bgdif * 80));
clip._x = 200 - (2 * (angle - clop.rot));
if ((clip.stab.hitTest(tx, ty, true) and (rider._currentframe < 100)) and (clicked == 1)) {
rider.gotoAndPlay("attack1");
gstate = 3;
dragonDead = 1;
}
if (clip.spine.targRect.hitTest(rider.targRect) or clip.spine.targRect2.hitTest(rider.targRect)) {
if (((deathCounter < 1) and (gstate > 0)) and (camDif < 70)) {
lives = lives - 1;
makeSplat(rider._x, rider._y, 10, 0);
sndScream.start();
deathCounter = 30;
if (lives == 0) {
rider.gotoAndPlay("dead");
rider._y = rider._y - 20;
gstate = 2;
}
}
}
clip.segNum = (segy - 7) + _local2;
clip.segNum2 = Math.floor(clop.rot);
clip._rotation = (angle - clop.rot) / 2;
clip.choice = 10;
segChoice = (segy - 7) + _local2;
clip.choice = dragArray[segChoice];
if ((dragonDead == 1) and (clip.choice == 12)) {
targetX = clip._x - 10;
targetY = clip._y + 10;
}
if (clip._currentframe != clip.choice) {
clip.gotoAndPlay(clip.choice);
}
if (clip.choice == 12) {
clip.head.gotoAndStop(level);
}
clip.spine._rotation = clip._rotation * 1.5;
clip.spine._x = -((clip._x - 200) / 2);
clip.spine._y = -23 - Math.abs((clip._x - 200) / 10);
_local2++;
}
}
function makeDragCode() {
dragArray = [];
i = 0;
while (i < (dragSize + 1)) {
dragArray.push(1);
i++;
}
dragArray.splice(8, 1);
dragArray.splice(8, 0, 11);
dragArray.splice(dragSize - 12, 1);
dragArray.splice(dragSize - 12, 0, 11);
dragArray.splice(3, 1);
dragArray.splice(3, 0, 12);
insert = 1;
spineExtra = 0;
if (level > 2) {
spineExtra = 1;
}
i = 0;
while (i < (dragSize + 1)) {
if (dragArray[i] == 1) {
insertLastMin = insert;
if (insert == 10) {
if (level > 1) {
spineChoice = Math.sin((i * 90) * (Math.PI/180));
if ((spineChoice < 0) and (spineExtra == 0)) {
spineChoice = 0;
}
insertLastMin = spineArray[spineExtra + Math.round(spineChoice)];
}
}
dragArray.splice(i, 1);
dragArray.splice(i, 0, Math.floor(insertLastMin));
}
if (dragArray[i] == 12) {
insert = 5;
}
ticker = 0;
if ((dragArray[i] == 11) and (insert == 5)) {
insert = 10;
ticker = 1;
}
if (((dragArray[i] == 11) and (ticker == 0)) and (insert == 10)) {
insert = 7;
}
dragArray.splice(Math.floor(dragSize / 2) - 4, 1);
dragArray.splice(Math.floor(dragSize / 2) - 4, 0, 13);
if (((insert > 1) and (insert < 8)) and (i > (dragSize / 2))) {
insert = insert - 0.5;
}
i++;
}
}
function initBG() {
camy = 1;
dragonDead = 0;
segy = dragSize;
rider.swapDepths(5000);
bgy = camy / 1;
bgdif = Math.floor(bgy / 80);
var _local2 = 0;
while (_local2 < 7) {
attachMovie("block", "block" + _local2, _local2);
clip = _root["block" + _local2];
clip._y = _local2 * 80;
clip._x = 200;
_local2++;
}
}
function initSounds() {
sndMusic = new Sound();
sndMusic.attachSound("s_music1");
sndRoar = new Sound();
sndRoar.attachSound("s_roar");
sndScream = new Sound();
sndScream.attachSound("s_scream");
sndWind = new Sound();
sndWind.attachSound("s_wind");
sndWind.start(0, 1000);
}
function makeSplat(xpos, ypos, amount, headAngle0) {
dripDrop = 100000000000000;
fistHyp = -arm.fist._y;
fistX = fistHyp * Math.sin(arm.rot * (Math.PI/180));
fistY = fistHyp * Math.cos(arm.rot * (Math.PI/180));
dot._x = arm._x + fistX;
dot._y = arm._y - fistY;
head.xmov1 = head._x - dot._x;
head.ymov1 = head._y - dot._y;
headAngle = 57.2957795130823 * headAngle0;
i = 0;
while (i < amount) {
attachMovie("blood", "blood" + i, 6000 + i);
clip = _root["blood" + i];
clip.angle = ((180 + headAngle) + (Math.random(1) * 180)) - 90;
clip.speed = 10 + (Math.random(1) * 10);
if (clip.speed < 12) {
clip.blood = Math.floor(Math.random(1) * 4);
clip.bloodType.gotoAndPlay(clip.blood);
}
clip.xmov = (-clip.speed) * Math.sin(clip.angle * (Math.PI/180));
clip.ymov = clip.speed * Math.cos(clip.angle * (Math.PI/180));
clip._x = xpos;
clip._y = ypos;
i++;
}
dripTimer = 0;
bloodNum = 1;
}
function moveSplat() {
i = 0;
while (i < 60) {
clip = _root["blood" + i];
clip._x = clip._x + clip.xmov;
if (((clip._y + clip.ymov) > 500) and (clip._currentframe == 1)) {
clip._yscale = 100;
clip._xscale = 100;
clip._rotation = 0;
clip.y = ground.y;
clip.ymov = 0;
clip.xmov = 0;
if (clip.bloodType._currentframe == 1) {
clip.gotoAndPlay(2);
}
if (clip.bloodType._currentframe > 1) {
clip.gotoAndPlay("bit" + clip.bloodType._currentframe);
}
}
clip._y = clip._y + clip.ymov;
if (clip._currentframe == 1) {
clip.ymov = clip.ymov + 1;
if (Math.abs(clip.xmov) > 0) {
clip.xmov = clip.xmov - (clip.xmov / 10);
}
clip.angle = 57.2957795130823 * Math.atan(clip.xmov / (-clip.ymov));
clip.hyp = Math.sqrt((clip.xmov * clip.xmov) + (clip.ymov * clip.ymov));
if (clip.hyp > 16) {
clip.hyp = 16;
}
clip._yscale = (clip.hyp / 4) * 100;
if (clip._yscale < 100) {
clip._yscale = 100;
}
clip._rotation = clip.angle;
if (clip.ymov > 0) {
clip._rotation = clip.angle + 180;
}
}
i++;
}
}
startgame();
stop();
Instance of Symbol 67 MovieClip in Frame 5
onClipEvent (enterFrame) {
_root.game();
}
onClipEvent (mouseDown) {
_root.clickdown();
}
onClipEvent (mouseUp) {
_root.clickup();
}
Symbol 7 MovieClip Frame 1
stop();
Symbol 7 MovieClip Frame 2
stop();
Symbol 7 MovieClip Frame 3
stop();
Symbol 7 MovieClip Frame 4
stop();
Symbol 7 MovieClip Frame 5
stop();
Symbol 7 MovieClip Frame 6
stop();
Symbol 10 MovieClip [blood] Frame 1
stop();
Instance of Symbol 7 MovieClip "bloodType" in Symbol 10 MovieClip [blood] Frame 1
/* no clip actions */
Symbol 10 MovieClip [blood] Frame 11
stop();
Symbol 10 MovieClip [blood] Frame 12
stop();
Symbol 10 MovieClip [blood] Frame 13
stop();
Symbol 10 MovieClip [blood] Frame 14
stop();
Symbol 10 MovieClip [blood] Frame 15
stop();
Symbol 10 MovieClip [blood] Frame 16
stop();
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 2
stop();
Symbol 25 MovieClip Frame 3
stop();
Symbol 25 MovieClip Frame 4
stop();
Symbol 25 MovieClip Frame 5
stop();
Symbol 43 MovieClip [block] Frame 1
stop();
Symbol 43 MovieClip [block] Frame 2
stop();
Symbol 43 MovieClip [block] Frame 3
stop();
Symbol 43 MovieClip [block] Frame 4
stop();
Symbol 43 MovieClip [block] Frame 5
stop();
Symbol 43 MovieClip [block] Frame 6
stop();
Symbol 43 MovieClip [block] Frame 7
stop();
Symbol 43 MovieClip [block] Frame 8
stop();
Symbol 43 MovieClip [block] Frame 10
stop();
Symbol 43 MovieClip [block] Frame 11
stop();
Symbol 43 MovieClip [block] Frame 12
stop();
Symbol 43 MovieClip [block] Frame 13
stop();
Symbol 43 MovieClip [block] Frame 14
stop();
Symbol 43 MovieClip [block] Frame 15
stop();
Symbol 55 MovieClip Frame 1
stop();
Instance of Symbol 54 MovieClip in Symbol 55 MovieClip Frame 2
/* no clip actions */
Symbol 55 MovieClip Frame 20
stop();
Symbol 106 MovieClip Frame 26
gotoAndPlay ("still");
Symbol 106 MovieClip Frame 47
gotoAndPlay ("run");
Symbol 106 MovieClip Frame 90
gotoAndPlay (1);
Symbol 106 MovieClip Frame 154
stop();
Symbol 106 MovieClip Frame 156
stop();
Symbol 115 Button
on (release) {
gotoAndPlay (21);
}
Symbol 137 MovieClip Frame 13
stop();
Symbol 150 MovieClip Frame 20
gotoAndPlay (1);
Symbol 150 MovieClip Frame 63
stop();
Symbol 150 MovieClip Frame 80
stop();
Symbol 150 MovieClip Frame 130
stop();
Symbol 150 MovieClip Frame 167
gotoAndPlay (1);