Frame 1
function expandMacro(macro) {
var macroPos = 0;
var expanded = "";
var nowMacro = "";
var nextMacro = "";
var prevMacro = "";
var copyMacro = "";
var nowMacroCharCode = 0;
var nextMacroCharCode = 0;
var copyCoundStr = "";
var copyCount = 0;
var copyLoop = 0;
macroPos = 0;
while (macroPos < macro.length) {
nowMacro = macro.charAt(macroPos);
nowMacroCharCode = nowMacro.charCodeAt(0);
if ((nowMacroCharCode >= 48) && (57 >= nowMacroCharCode)) {
copyCountStr = nowMacro;
nextMacro = macro.charAt(macroPos + 1);
nextMacroCharCode = nextMacro.charCodeAt(0);
if ((nextMacroCharCode >= 48) && (57 >= nextMacroCharCode)) {
copyCountStr = copyCountStr.concat(nextMacro);
macroPos++;
}
copyCount = copyCountStr;
copyCount--;
if (prevMacro == DISABLE_NOTE) {
copyMacro = prevMacro;
} else {
copyMacro = " ";
}
copyLoop = 0;
while (copyLoop < CopyCount) {
expanded = expanded.concat(copyMacro);
copyLoop++;
}
} else {
expanded = expanded.concat(nowMacro);
prevMacro = nowMacro;
}
macroPos++;
}
return(expanded);
}
function getTotalNotes(nowScore) {
var i = 0;
var note = "";
var count = 0;
i = 0;
while (i < nowScore.length) {
note = nowScore.charAt(i);
if ((((note == NOTE_LEFT) || (note == NOTE_BOTTOM)) || (note == NOTE_TOP)) || (note == NOTE_RIGHT)) {
count++;
}
i++;
}
return(count);
}
function timeKeeping() {
var nowNote = "";
var noteName = "";
var clipName = "";
var nowFurituke = "";
var nowFuritukeIdx = 0;
var runningFuritukeIdx = 0;
var loopin = 0;
var clipX = 0;
var clipY = 0;
var i = 0;
var perfectNote = "";
var greatNote = "";
var goodNote = "";
perfectNote = score.charAt(_currentframe - MUSIC_IN_FRAME);
greatNote = score.charAt((_currentframe - MUSIC_IN_FRAME) - 1);
goodNote = score.charAt((_currentframe - MUSIC_IN_FRAME) + 1);
if (nowFrame == (MUSIC_LENGTH + (MUSIC_IN_FRAME - TIMEKEEP_START_FRAME))) {
_root.gotoAndPlay(EVALUATION_FRAME);
return(undefined);
}
nowNote = score.charAt(((nowFrame + TIMEKEEP_START_FRAME) - MUSIC_IN_FRAME) + PERFECT_FRAME);
if (nowNote == NOTE_LEFT) {
clipName = "ARROW_LEFT";
clipX = 72;
clipY = 504;
} else if (nowNote == NOTE_BOTTOM) {
clipName = "ARROW_BOTTOM";
clipX = 126;
clipY = 504;
} else if (nowNote == NOTE_TOP) {
clipName = "ARROW_TOP";
clipX = 180;
clipY = 504;
} else if (nowNote == NOTE_RIGHT) {
clipName = "ARROW_RIGHT";
clipX = 234;
clipY = 504;
}
if (0 < clipX) {
noteName = "note" + noteNumber;
noteNumber = (noteNumber + 1) % NOTE_MAX;
this.attachMovie(clipName, noteName, noteNumber);
this[noteName]._X = clipX;
this[noteName]._Y = 528;
this[noteName].appearedFrame = nowFrame;
this[noteName].proceeded = false;
}
nowFurituke = furituke.charAt((nowFrame + TIMEKEEP_START_FRAME) - MUSIC_IN_FRAME);
if (((furitukeHalt < 2) && (nowFurituke != " ")) && (nowFurituke != "")) {
nowFuritukeIdx = nowFurituke.charCodeAt(0) - 97;
if (0 < DANCE_ARRAY[nowFuritukeIdx]) {
_root.DANCING_BOY.gotoAndStop(DANCE_ARRAY[nowFuritukeIdx]);
runningFurituke = nowFurituke;
furitukeStop = false;
furitukeHalt = 0;
} else if ((nowFuritukeIdx = 123)) {
furitukeStop = true;
_root.DANCING_BOY.stop();
} else {
trace("illegal furituke");
}
} else {
furitukeSeqCtrl();
}
i = 0;
while (i < NOTE_MAX) {
if ((this["note" + i].proceeded == true) && (this["note" + i].appearedFrame < (nowFrame - 22))) {
this["note" + i].unloadMovie();
} else if (((this["note" + i].proceeded == false) && (this["note" + i].appearedFrame < (nowFrame - 21))) && (0 < this["note" + i].appearedFrame)) {
this["note" + i].unloadMovie();
_root.timingMessage(MESSAGE_OUCH);
ouch++;
_root.ComboClip.combo = 0;
}
i++;
}
nowFrame++;
}
function timeKeeping2() {
var volume = 100;
fadeoutMusic();
furitukeSeqCtrl();
}
function timeKeeping_score() {
var nowPerfectRate = 0;
var scoreBoardFrame = 1;
var jumpFrame = 0;
var stampFrame = 0;
if (nowFrame < 15) {
nowPerfectRate = (perfectRate * (nowFrame + 1)) / 15;
scoreBoardFrame = Math.floor(nowPerfectRate / 10) + 2;
_root.scoreBoardClip.gotoAndStop(scoreBoardFrame);
scoreBoardRate = Math.Floor(Math.random() * 100);
} else if (nowFrame < 20) {
scoreBoardRate = Math.floor(perfectRate);
_root.scoreNumClip.gotoAndStop(2);
} else {
if (perfectRate >= 95) {
stampFrame = 2;
jumpFrame = CLEAR_FRAME;
} else if (perfectRate >= 70) {
stampFrame = 3;
jumpFrame = CLEAR_FRAME;
} else if (perfectRate >= 35) {
stampFrame = 4;
jumpFrame = UNCLEAR_FRAME;
} else {
stampFrame = 5;
jumpFrame = UNCLEAR_FRAME;
}
_root.stampClip.gotoAndPlay(stampFrame);
gotoAndPlay(jumpFrame);
}
nowFrame++;
}
function fadeoutMusic() {
volume = mainMusic.getVolume();
if (0 < volume) {
mainMusic.setVolume(volume - 10);
}
}
function furitukeSeqCtrl() {
runningFuritukeIdx = runningFurituke.charCodeAt(0) - 97;
if (_root.DANCING_BOY._currentFrame == DANCE_LOOP[runningFuritukeIdx]) {
if (!furitukeStop) {
if (DANCE_LOOPIN[runningFuritukeIdx] == "!") {
if (runningFurituke == "b") {
furitukeHalt = 1;
}
} else {
loopin = DANCE_ARRAY[DANCE_LOOPIN[runningFuritukeIdx].charCodeAt(0) - 97];
_root.DANCING_BOY.gotoAndStop(loopin);
runningFurituke = DANCE_LOOPIN[runningFuritukeIdx];
}
}
} else if (!furitukeStop) {
_root.DANCING_BOY.nextFrame();
}
}
function keycodeExchange(pressedKey) {
if ((pressedKey == 104) || (pressedKey == 51)) {
pressedKey = Key.UP;
} else if ((pressedKey == 98) || (pressedKey == 50)) {
pressedKey = Key.DOWN;
} else if ((pressedKey == 100) || (pressedKey == 49)) {
pressedKey = Key.LEFT;
} else if ((pressedKey == 102) || (pressedKey == 52)) {
pressedKey = Key.RIGHT;
}
return(pressedKey);
}
function noteExchange(note) {
var exchanged = 0;
if (note == NOTE_LEFT) {
exchanged = Key.LEFT;
} else if (note == NOTE_BOTTOM) {
exchanged = Key.DOWN;
} else if (note == NOTE_TOP) {
exchanged = Key.UP;
} else if (note == NOTE_RIGHT) {
exchanged = Key.RIGHT;
}
return(exchanged);
}
function checkKeyPress(pressedKey) {
var message_pattern = 99;
var scorePos = 0;
var perfectNote = "";
var greatNote = "";
var goodNote = "";
var thisFrame = 0;
pressedKey = _root.keycodeExchange(pressedKey);
if ((((pressedKey != Key.UP) && (pressedKey != Key.DOWN)) && (pressedKey != Key.LEFT)) && (pressedKey != Key.RIGHT)) {
return(undefined);
}
thisFrame = ((nowFrame + TIMEKEEP_START_FRAME) - MUSIC_IN_FRAME) - 1;
perfectNote = score.charAt(thisFrame);
greatNote = score.charAt(thisFrame + 1);
goodNote = score.charAt(thisFrame - 1);
if ((perfectNote == DISABLE_NOTE) || (perfectNote == "")) {
} else if (pressedKey == _root.noteExchange(perfectNote)) {
perfect++;
message_pattern = MESSAGE_PERFECT;
scorePos = thisFrame;
} else if (pressedKey == _root.noteExchange(greatNote)) {
great++;
message_pattern = MESSAGE_GREAT;
scorePos = thisFrame + 1;
} else if (pressedKey == _root.noteExchange(goodNote)) {
good++;
message_pattern = MESSAGE_GOOD;
scorePos = thisFrame - 1;
} else {
bad++;
message_pattern = MESSAGE_BAD;
_root.enlargeDunceCap(2);
if (furitukeHalt == 0) {
_root.DANCING_BOY.gotoAndStop(DANCE_ARRAY[1]);
runningFurituke = "b";
furitukeHalt = 2;
furitukeStop = false;
}
}
if (message_pattern < MESSAGE_BAD) {
score_temp = (score.substring(0, scorePos) + "x") + score.substring(scorePos + 1);
score = score_temp;
_root.noteUnloadPrepare(((scorePos - TIMEKEEP_START_FRAME) + MUSIC_IN_FRAME) - PERFECT_FRAME);
}
if (message_pattern == MESSAGE_PERFECT) {
_root.ComboClip.combo++;
if (4 < _root.ComboClip.combo) {
_root.ComboClip.gotoAndPlay(2);
_root.enlargeDunceCap(-1);
}
if (combo_max < _root.ComboClip.combo) {
combo_max = _root.ComboClip.combo;
}
} else {
_root.ComboClip.combo = 0;
}
_root.timingMessage(message_pattern);
}
function timingMessage(message_pattern) {
_root.MessageClip.gotoAndPlay((message_pattern * 5) + 2);
}
function noteUnloadPrepare(appearedFrame) {
var i = 0;
i = 0;
while (i < NOTE_MAX) {
if (this["note" + i].appearedFrame == appearedFrame) {
this["note" + i].proceeded = true;
this["note" + i].gotoAndPlay(23);
i = NOTE_MAX;
}
i++;
}
}
function enlargeDunceCap(direction) {
dunceCapNum = dunceCapNum + direction;
if (dunceCapNum < 0) {
dunceCapnum = 0;
}
_root.DUNCE_CAP._yscale = 100 + (dunceCapNum * 40);
_root.DUNCE_CAP._xscale = 100 + (dunceCapNum * 5);
_root.DUNCECAP_SHADOW._xscale = 100 + (dunceCapNum * 5);
_root.DUNCE_CAP._y = 420 + ((dunceCapNum * 12.4) * -1);
if (DUNCECAP_MAX < dunceCapNum) {
_root.StampClip.gotoAndStop(5);
gotoAndPlay(FAILED_FRAME);
}
}
function clearMessage() {
ComboClip.gotoAndStop(1);
MessageClip.gotoAndStop(1);
}
NOTE_MAX_FRAME = 22;
PERFECT_FRAME = 20;
TIMEKEEP_START_FRAME = 18;
MUSIC_IN_FRAME = 29;
EVALUATION_FRAME = 48;
CLEAR_FRAME = 65;
UNCLEAR_FRAME = 90;
FAILED_FRAME = 32;
GAME_OVER_FRAME = 107;
CONTINUE_FRAME = 110;
BACK_MENU_FRAME = 118;
CLEAR_DEMO_FRAME = 126;
END_DEMO_FRAME = 145;
NEXT_STAGE_FRAME = 150;
MUSIC_LENGTH = 990;
TITLE_URL = "TITLE.SWF";
NEXT_MUSIC_URL = "JI.SWF";
NOTE_MAX = 22;
DUNCECAP_MAX = 14;
MESSAGE_PERFECT = 0;
MESSAGE_GREAT = 1;
MESSAGE_GOOD = 2;
MESSAGE_BAD = 3;
MESSAGE_OUCH = 4;
NOTE_LEFT = "a";
NOTE_BOTTOM = "b";
NOTE_TOP = "c";
NOTE_RIGHT = "d";
DISABLE_NOTE = "z";
DANCE_ARRAY = new Array();
DANCE_LOOP = new Array();
DANCE_LOOPIN = new Array();
DANCE_ARRAY[0] = 1;
DANCE_LOOP[0] = 4;
DANCE_LOOPIN[0] = "a";
DANCE_ARRAY[1] = 4;
DANCE_LOOP[1] = 9;
DANCE_LOOPIN[1] = "!";
DANCE_ARRAY[2] = 10;
DANCE_LOOP[2] = 15;
DANCE_LOOPIN[2] = "c";
DANCE_ARRAY[3] = 16;
DANCE_LOOP[3] = 31;
DANCE_LOOPIN[3] = "d";
DANCE_ARRAY[4] = 32;
DANCE_LOOP[4] = 35;
DANCE_LOOPIN[4] = "f";
DANCE_ARRAY[5] = 36;
DANCE_LOOP[5] = 39;
DANCE_LOOPIN[5] = "f";
DANCE_ARRAY[6] = 40;
DANCE_LOOP[6] = 43;
DANCE_LOOPIN[6] = "a";
DANCE_ARRAY[7] = 44;
DANCE_LOOP[7] = 47;
DANCE_LOOPIN[7] = "a";
DANCE_ARRAY[8] = 48;
DANCE_LOOP[8] = 49;
DANCE_LOOPIN[8] = "j";
DANCE_ARRAY[9] = 50;
DANCE_LOOP[9] = 53;
DANCE_LOOPIN[9] = "j";
DANCE_ARRAY[10] = 54;
DANCE_LOOP[10] = 55;
DANCE_LOOPIN[10] = "l";
DANCE_ARRAY[11] = 56;
DANCE_LOOP[11] = 59;
DANCE_LOOPIN[11] = "l";
DANCE_ARRAY[12] = 60;
DANCE_LOOP[12] = 61;
DANCE_LOOPIN[12] = "n";
DANCE_ARRAY[13] = 62;
DANCE_LOOP[13] = 65;
DANCE_LOOPIN[13] = "n";
DANCE_ARRAY[14] = 66;
DANCE_LOOP[14] = 67;
DANCE_LOOPIN[14] = "a";
DANCE_ARRAY[15] = 68;
DANCE_LOOP[15] = 69;
DANCE_LOOPIN[15] = "q";
DANCE_ARRAY[16] = 70;
DANCE_LOOP[16] = 73;
DANCE_LOOPIN[16] = "q";
DANCE_ARRAY[17] = 74;
DANCE_LOOP[17] = 75;
DANCE_LOOPIN[17] = "a";
DANCE_ARRAY[18] = 76;
DANCE_LOOP[18] = 84;
DANCE_LOOPIN[18] = "!";
DANCE_ARRAY[19] = 85;
DANCE_LOOP[19] = 92;
DANCE_LOOPIN[19] = "a";
DANCE_ARRAY[20] = 93;
DANCE_LOOP[20] = 96;
DANCE_LOOPIN[20] = "f";
DANCE_ARRAY[21] = 97;
DANCE_LOOP[21] = 112;
DANCE_LOOPIN[21] = "v";
DANCE_ARRAY[22] = 113;
DANCE_LOOP[22] = 128;
DANCE_LOOPIN[22] = "w";
furituke = "a16a8h4a2w16w16w16w16w16w16w16w10h4a2w16w16w16w16w16w16w16w10h4e4f16f12g4a16a12e4f16f12g4a16a6c6e4f16f12g4a16a12e4f16f12g4a16a6c6a2w16w16w16w16w16w16w16w10h4a2w16w16w16w16w16w16w16w10h4a4t8a8a12e4f12g4h3h3h3h3h3mn14o2a14c6a4h4a2c6a4h4a4a8s9z";
score = "z30 2d8a8d8a8d8a8d8a4c4d8a8d8a8d8a8d8a2b2c4d8a8d8a8d8a8d8a4c4d8a8d8a8d8a3c3b2d8a2b2c4c8c8c8b4c4b8b8b8c4b4c8c8c8b4c4b8b8b8a2b2c2d2c8c8c8b4c4b8b8b8c4b4c8c8c8b4c4b8b8b8c4b4d8a8d8a8d8a8d8a4c4d8a8d8a8d8a8d8a2b2c4d8a8d8a8d8a8d8a4c4d8a8d8a8d8a3c3b2d8a2b2c4d6b2a8d6b2a8d6b2a8dba2dba2dba2dba2d6b2a8d6b2a4c4d4c4a3c3b2d4a4d3b3c2a12b2c10";
combo = 0;
combo_max = 0;
perfect = 0;
great = 0;
good = 0;
bad = 0;
ouch = 0;
dunceCapNum = 0;
debug = 0;
debug2 = 0;
debug3 = 0;
totalNotes = 0;
noteNumber = 0;
furitukeHalt = 0;
furitukeStop = false;
runningFurituke = "a";
nowFrame = 0;
MovieClip.prototype.appearedFrame = 0;
MovieClip.prototype.proceeded = false;
mainMusic = new Sound(SoundClip);
mainMusic.setVolume(100);
score = expandMacro(score);
furituke = expandMacro(furituke);
totalNotes = getTotalNotes(score);
Frame 2
wait = 0;
Instance of Symbol 15 MovieClip in Frame 2
onClipEvent (keyDown) {
if (_root._framesLoaded >= _root._totalFrames) {
_root.gotoAndPlay(13);
}
}
onClipEvent (mouseUp) {
if (_root._framesLoaded >= _root._totalFrames) {
_root.gotoAndPlay(13);
}
}
Frame 12
if ((_root._framesLoaded < _root._totalFrames) || (wait < 10)) {
wait++;
_root.gotoAndPlay(11);
}
Instance of Symbol 279 MovieClip in Frame 18
onClipEvent (enterFrame) {
_root.timeKeeping();
}
onClipEvent (keyDown) {
_root.checkKeyPress(Key.getCode());
}
Frame 31
if (31 >= _currentframe) {
gotoAndPlay (30);
}
Frame 32
i = 0;
while (i < NOTE_MAX) {
this["note" + i].unloadMovie();
i++;
}
clearMessage();
furitukeStop = false;
DANCING_BOY.gotoAndStop(5);
runningFurituke = "b";
Instance of Symbol 296 MovieClip in Frame 32
onClipEvent (enterFrame) {
_root.timeKeeping2();
}
Frame 47
if (47 >= _currentframe) {
gotoAndPlay(GAME_OVER_FRAME);
}
Frame 48
i = 0;
while (i < NOTE_MAX) {
this["note" + i].unloadMovie();
i++;
}
clearMessage();
if (totalNotes == 0) {
perfectRate = 0;
} else {
perfectRate = ((((perfect + (great * 0.3)) + (good * 0.2)) - (bad * 0.5)) / totalNotes) * 100;
}
if (perfectRate < 0) {
perfectRate = 0;
}
scoreBoardRate = 0;
nowFrame = 0;
Instance of Symbol 298 MovieClip in Frame 48
onClipEvent (enterFrame) {
_root.timeKeeping2();
}
Instance of Symbol 305 MovieClip in Frame 63
onClipEvent (enterFrame) {
_root.timeKeeping2();
_root.timeKeeping_score();
}
Frame 64
if (64 >= _currentframe) {
gotoAndPlay (63);
}
Frame 65
furitukeStop = false;
DANCING_BOY.gotoAndStop(10);
runningFurituke = "c";
wait = 0;
Instance of Symbol 298 MovieClip in Frame 65
onClipEvent (enterFrame) {
_root.timeKeeping2();
}
Frame 89
if (10 < wait) {
gotoAndPlay(CLEAR_DEMO_FRAME);
} else {
wait++;
gotoAndPlay (88);
}
Frame 90
i = 0;
while (i < NOTE_MAX) {
this["note" + i].unloadMovie();
i++;
}
clearMessage();
furitukeStop = false;
DANCING_BOY.gotoAndStop(5);
runningFurituke = "b";
Instance of Symbol 296 MovieClip in Frame 90
onClipEvent (enterFrame) {
_root.timeKeeping2();
}
Frame 109
if (109 >= _currentframe) {
gotoAndPlay (108);
}
Frame 117
gotoAndPlay (1);
Frame 125
_root.url = TITLE_URL;
loadMovieNum (_root.url, 0);
Frame 126
if (perfectRate < 90) {
demoClip.gotoAndStop(1);
} else {
demoClip.gotoAndStop(2);
}
Frame 142
if (perfectRate < 90) {
serifClip.gotoAndStop(2);
} else {
serifClip.gotoAndStop(3);
}
Instance of Symbol 325 MovieClip in Frame 142
onClipEvent (keyDown) {
_root.gotoAndPlay(145);
}
onClipEvent (mouseUp) {
_root.gotoAndPlay(145);
}
Frame 144
stop();
Frame 150
if (perfectRate < 95) {
gotoAndPlay (164);
}
Instance of Symbol 328 MovieClip in Frame 156
onClipEvent (keyDown) {
_root.gotoAndPlay(158);
}
onClipEvent (mouseUp) {
_root.gotoAndPlay(158);
}
Frame 157
if (_currentframe < 158) {
gotoAndPlay (156);
}
Frame 164
_root.url = _root.NEXT_MUSIC_URL;
loadMovieNum (_root.url, 0);
Symbol 4 MovieClip [ARROW_BOTTOM] Frame 25
this.stop();
Symbol 6 MovieClip [ARROW_RIGHT] Frame 25
this.stop();
Symbol 8 MovieClip [ARROW_TOP] Frame 25
this.stop();
Symbol 10 MovieClip [ARROW_LEFT] Frame 25
this.stop();
Symbol 285 MovieClip Frame 1
this.stop();
Symbol 285 MovieClip Frame 6
this.stop();
Symbol 285 MovieClip Frame 11
this.stop();
Symbol 285 MovieClip Frame 16
this.stop();
Symbol 285 MovieClip Frame 21
this.stop();
Symbol 285 MovieClip Frame 26
this.stop();
Symbol 289 MovieClip Frame 1
this.stop();
Symbol 289 MovieClip Frame 6
this.gotoAndPlay(1);
Symbol 294 MovieClip Frame 1
this.stop();
Symbol 294 MovieClip Frame 2
this.stop();
Symbol 294 MovieClip Frame 3
this.stop();
Symbol 294 MovieClip Frame 4
this.stop();
Symbol 294 MovieClip Frame 5
this.stop();
Symbol 303 MovieClip Frame 1
this.stop();
Symbol 303 MovieClip Frame 2
this.stop();
Symbol 303 MovieClip Frame 3
this.stop();
Symbol 303 MovieClip Frame 4
this.stop();
Symbol 303 MovieClip Frame 5
this.stop();
Symbol 303 MovieClip Frame 6
this.stop();
Symbol 303 MovieClip Frame 7
this.stop();
Symbol 303 MovieClip Frame 8
this.stop();
Symbol 303 MovieClip Frame 9
this.stop();
Symbol 303 MovieClip Frame 10
this.stop();
Symbol 303 MovieClip Frame 11
this.stop();
Symbol 303 MovieClip Frame 12
this.stop();
Symbol 304 MovieClip Frame 1
this.stop();
Symbol 304 MovieClip Frame 2
this.stop();
Symbol 304 MovieClip Frame 3
this.stop();
Symbol 304 MovieClip Frame 4
this.stop();
Symbol 304 MovieClip Frame 5
this.stop();
Symbol 304 MovieClip Frame 6
this.stop();
Symbol 304 MovieClip Frame 7
this.stop();
Symbol 304 MovieClip Frame 8
this.stop();
Symbol 304 MovieClip Frame 9
this.stop();
Symbol 304 MovieClip Frame 10
this.stop();
Symbol 304 MovieClip Frame 11
this.stop();
Symbol 304 MovieClip Frame 12
this.stop();
Symbol 308 MovieClip Frame 1
this.stop();
Symbol 308 MovieClip Frame 2
this.stop();
Symbol 313 Button
on (release) {
gotoAndPlay(CONTINUE_FRAME);
}
Symbol 316 Button
on (release) {
gotoAndPlay (120);
}
Symbol 321 MovieClip Frame 1
this.stop();
Symbol 321 MovieClip Frame 2
this.stop();
Symbol 324 MovieClip Frame 1
this.stop();
Symbol 324 MovieClip Frame 2
this.stop();
Symbol 324 MovieClip Frame 3
this.stop();