Frame 1
stop();
Frame 3
function fadeThemesong() {
onEnterFrame = fade;
}
themesong1_sound = new Sound();
themesong1_sound.attachSound("themestart");
themesong1_sound.onSoundComplete = function () {
trace("loop");
themesong1_sound.start(16.006, 0);
};
fade = function () {
vol = themesong1_sound.getVolume() - 2;
themesong1_sound.setVolume(vol);
if (vol == 0) {
onEnterFrame = undefined;
themesong1_sound.stop();
themesong1_sound.setVolume(100);
}
};
stopAllSounds();
themesong1_sound.start(0, 0);
Frame 4
stop();
Frame 6
function startGame(difficulty) {
if (difficulty == "easy") {
sentences_array = easy_array;
gameQNum = easyQNum;
} else if (difficulty == "medium") {
sentences_array = medium_array;
gameQNum = mediumQNum;
} else if (difficulty == "hard") {
sentences_array = hard_array;
gameQNum = hardQNum;
} else {
trace("ERROR: No difficulty specified!");
}
totalGameTime = getTimer();
gameDifficulty = difficulty;
UI._visible = true;
Mouse.removeListener(scribbleListener);
Mouse.addListener(scribbleListener);
generateSentence();
}
function endGame() {
clearBoard();
UI._visible = false;
Mouse.removeListener(scribbleListener);
scorePlayer();
}
function scorePlayer() {
sc = addCutscene("score");
totalGameTime = getTimer() - totalGameTime;
initMils = totalGameTime % 1000;
initSec = Math.round(((totalGameTime - initMils) / 1000) % 60);
initMin = Math.floor((((totalGameTime - initMils) / 1000) / 60) % 60);
errorsMills = errorsNum * 5000;
totalGameTime = totalGameTime + errorsMills;
totalMils = totalGameTime % 1000;
totalSec = Math.round(((totalGameTime - totalMils) / 1000) % 60);
totalMin = Math.floor((((totalGameTime - totalMils) / 1000) / 60) % 60);
if (initMin == 0) {
sc.time_txt.text = initSec + " sec.";
} else {
sc.time_txt.text = ((initMin + " min. ") + initSec) + " sec.";
}
sc.penalty_txt.text = ((errorsNum + " x 5 sec = ") + (errorsMills / 1000)) + " sec.";
if (totalMin == 0) {
sc.total_txt.text = totalSec + " sec.";
} else {
sc.total_txt.text = ((totalMin + " min. ") + totalSec) + " sec.";
}
sc.difficulty_txt.text = gameDifficulty;
rankTitle = "";
rankClip = "exportName";
if (totalMin < 1) {
rankTitle = "Master Warrior";
rankClip = "masterRank";
} else if (totalMin < 3) {
rankTitle = "Grammar Ninja";
rankClip = "ninjaRank";
} else {
rankTitle = "Student";
rankClip = "studentRank";
}
sc.rank_txt.text = rankTitle;
sc.attachMovie(rankClip, "rankPic", 1);
sc.rankPic._x = 400;
sc.rankPic._y = 125;
sc.rankPic._visible = false;
}
function generateSentence() {
clearBoard();
if (gameQNum == 0) {
endGame();
} else {
gameQNum--;
if (sentences_array.length == 0) {
trace("ERROR: sentences_array has no content");
} else {
tempArray = sentences_array.splice(random(sentences_array.length), 1);
newSen = tempArray[0];
findSentenceData(newSen);
i = 0;
while (i < newSen.length) {
createGB(newSen[i]);
i++;
}
alignGB();
}
}
}
function findSentenceData(pSen) {
i = 0;
while (i < pSen.length) {
pos = pSen[i].getPOS();
if (pos == "N") {
nounNum++;
} else if (pos == "V") {
verbNum++;
} else if (pos == "PRO") {
pronounNum++;
} else if (pos == "ADJ") {
adjectiveNum++;
} else if (pos == "ADV") {
adverbNum++;
} else if (pos == "PREP") {
prepositionNum++;
} else if (pos == "CONJ") {
conjunctionNum++;
} else if (pos == "INT") {
interjectionNum++;
} else if (pos == "ART") {
articleNum++;
}
i++;
}
determinePOS();
}
function determinePOS() {
instructedPOS = "unknown";
instructText = "unknown";
var _local1 = -1;
while (instructedPOS == "unknown") {
if (gameDifficulty == "unknown") {
trace("ERROR: gameDifficulty unknown in determinePOS()");
} else if (gameDifficulty == "easy") {
_local1 = random(2);
} else if (gameDifficulty == "medium") {
_local1 = random(5);
} else if (gameDifficulty == "hard") {
_local1 = random(9);
}
if (_local1 == -1) {
trace("ERROR: aNum not randomized in determinePOS()");
} else if (_local1 == 0) {
if (nounNum > 0) {
instructText = "Noun";
instructedPOS = "N";
instructedPOSNum = nounNum;
explainationText = nounExpl;
if (nounNum > 1) {
instructText = "Nouns";
}
}
} else if (_local1 == 1) {
if (verbNum > 0) {
instructText = "Verb";
instructedPOS = "V";
instructedPOSNum = verbNum;
explainationText = verbExpl;
if (verbNum > 1) {
instructText = "Verbs";
}
}
} else if (_local1 == 2) {
if (articleNum > 0) {
instructText = "Article";
instructedPOS = "ART";
instructedPOSNum = articleNum;
explainationText = articleExpl;
if (articleNum > 1) {
instructText = "Articles";
}
}
} else if (_local1 == 3) {
if (adjectiveNum > 0) {
instructText = "Adjective";
instructedPOS = "ADJ";
instructedPOSNum = adjectiveNum;
explainationText = adjectiveExpl;
if (adjectiveNum > 1) {
instructText = "Adjectives";
}
}
} else if (_local1 == 4) {
if (adverbNum > 0) {
instructText = "Adverb";
instructedPOS = "ADV";
instructedPOSNum = adverbNum;
explainationText = adverbExpl;
if (adverbNum > 1) {
instructText = "Adverbs";
}
}
} else if (_local1 == 5) {
if (perpositionNum > 0) {
instructText = "Preposition";
instructedPOS = "PREP";
instructedPOSNum = perpositionNum;
explainationText = perpositionExpl;
if (perpositionNum > 1) {
instructText = "Prepositions";
}
}
} else if (_local1 == 6) {
if (conjunctionNum > 0) {
instructText = "Conjunction";
instructedPOS = "CONJ";
instructedPOSNum = conjunctionNum;
explainationText = conjunctionExpl;
if (conjunctionNum > 1) {
instructText = "Conjunctions";
}
}
} else if (_local1 == 7) {
if (interjectionNum > 0) {
instructText = "Interjection";
instructedPOS = "INT";
instructedPOSNum = interjectionNum;
explainationText = interjectionExpl;
if (interjectionNum > 1) {
instructText = "Interjections";
}
}
} else if (_local1 == 8) {
if (pronounNum > 0) {
instructText = "Pronoun";
instructedPOS = "PRO";
instructedPOSNum = pronounNum;
explainationText = pronounExpl;
if (pronounNum > 1) {
instructText = "Pronouns";
}
}
}
}
UI.dir_txt.text = ("Find the " + instructText) + "!";
UI.remain_txt.text = instructedPOSNum + " left.";
}
function clearBoard() {
this.attachMovie("attachMeClip", "GBLayer", 3);
this.attachMovie("attachMeClip", "correctLayer", 5);
this.attachMovie("attachMeClip", "wrongLayer", 6);
this.attachMovie("attachMeClip", "starLayer", 8);
clearScribble();
grammarBox_array = new Array();
ninjaStar_array = new Array();
correct_array = new Array();
wrong_array = new Array();
nounNum = 0;
verbNum = 0;
pronounNum = 0;
adjectiveNum = 0;
adverbNum = 0;
prepositionNum = 0;
conjunctionNum = 0;
interjectionNum = 0;
articleNum = 0;
}
function advance() {
instructedPOSNum--;
UI.remain_txt.text = instructedPOSNum + " left.";
UI.tellPOS_txt.text = "Good work ninja!";
if (instructedPOSNum == 0) {
generateSentence();
}
}
function wrongComplete(pPOS) {
UI.tellPOS_txt.text = ("That was a " + pPOS) + ".";
if (((pPOS == "Adjective") || (pPOS == "Adverb")) || (pPOS == "Article")) {
UI.tellPOS_txt.text = ("That was an " + pPOS) + ".";
}
errorsNum++;
}
function starthrow() {
starDepth = starLayer.getNextHighestDepth();
ns = ["ninjastar" + starDepth];
starLayer.attachMovie("starthrow", ns, starDepth);
starLayer[ns]._x = _xmouse;
starLayer[ns]._y = _ymouse;
soundNum = random(3);
if (soundNum == 0) {
ninjastar1_sound.start(0.055, 0);
} else if (soundNum == 1) {
ninjastar2_sound.start(0.04, 0);
} else {
ninjastar3_sound.start(0.15, 0);
}
ninjaStar_array.push(starLayer[ns]);
return(starLayer[ns]);
}
function addcorrect(gb) {
correctDepth = correctLayer.getNextHighestDepth();
cr = ["correct" + correctDepth];
correctLayer.attachMovie("correct", cr, correctDepth);
correctLayer[cr]._x = gb._x + (gb._width / 2);
correctLayer[cr]._y = gb._y + (gb._height / 2);
correctLayer[cr]._width = (correctLayer[cr]._height = (gb._width * 2) / 3);
correct_array.push(correctLayer[cr]);
return(correctLayer[cr]);
}
function addWrong(gb) {
wrongDepth = wrongLayer.getNextHighestDepth();
wr = ["wrongClip" + wrongDepth];
wrongLayer.attachMovie("wrongClip", wr, wrongDepth);
wrongLayer[wr]._x = gb._x + (gb._width / 2);
wrongLayer[wr]._y = gb._y + (gb._height / 2);
oldWidth = wrongLayer[wr]._width;
wrongLayer[wr]._width = gb._width;
wrongLayer[wr]._height = wrongLayer[wr]._height + ((oldWidth - gb._width) / gb._width);
wrongLayer[wr].myGB = gb;
wrong_array.push(wrongLayer[wr]);
return(wrongLayer[wr]);
}
function addCutscene(clipName) {
cutsceneLayer.attachMovie(clipName, "currentCutscene", 1);
return(cutsceneLayer.currentCutscene);
}
function removeCutscene() {
this.attachMovie("attachMeClip", "cutsceneLayer", 10);
}
function addIntro(difficulty) {
gn = addCutscene("intro");
gn.d = difficulty;
}
function createGB(pWord) {
gramboxDepth = GBLayer.getNextHighestDepth();
gb = ["grammarBox" + gramboxDepth];
GBLayer.attachMovie("grambox", gb, gramboxDepth);
GBLayer[gb].init(pWord, "textbutton");
grammarBox_array.push(GBLayer[gb]);
return(GBLayer[gb]);
}
function GBClicked(gb) {
starthrow();
if (!gb.getClicked()) {
if (gb.getPOS() == instructedPOS) {
addcorrect(gb);
} else {
addWrong(gb);
}
}
}
function alignGB() {
alignedwell = false;
maxwidth = Stage.width;
maxheight = 280;
endmarginx = 30;
endmarginy = 40;
marginx = 15;
marginy = 30;
while (!alignedwell) {
boxwidth = 0;
boxheight = 0;
linenum = 1;
boxwidth = boxwidth + endmarginx;
i = 0;
while (i < grammarBox_array.length) {
boxwidth = boxwidth + grammarBox_array[i]._width;
if (boxwidth > (maxwidth - endmarginx)) {
linenum++;
boxwidth = (0 + endmarginx) + grammarBox_array[i]._width;
}
boxwidth = boxwidth + marginx;
i++;
}
boxheight = endmarginy + (linenum * (marginy + grammarBox_array[0]._height));
if (boxheight > maxheight) {
j = 0;
while (j < grammarBox_array.length) {
gba = grammarBox_array[j];
gba.resizeText(gba.getFontSize() - 2);
alignedwell = false;
j++;
}
} else {
alignedwell = true;
}
}
cx = endmarginx;
cy = endmarginy + marginy;
i = 0;
while (i < grammarBox_array.length) {
gba = grammarBox_array[i];
cx = cx + gba._width;
if (cx > (maxwidth - endmarginx)) {
cx = endmarginx;
cy = cy + (gba._height + marginy);
gba.setPosition(cx, cy);
cx = cx + gba._width;
} else {
gba.setPosition(cx - gba._width, cy);
}
cx = cx + marginx;
i++;
}
}
function scribble() {
scribbleLayer.lineTo(scribbleLayer._xmouse, scribbleLayer._ymouse);
scribbleLayer.prevx = scribbleLayer._xmouse;
scribbleLayer.prevy = scribbleLayer._ymouse;
}
function clearScribble() {
scribbleLayer.clear();
}
easy_array = new Array();
esen001 = new Array(new Word("Joe", "N"), new Word("is", "V"), new Word("hungry.", "ADJ"));
esen002 = new Array(new Word("Mario", "N"), new Word("broke", "V"), new Word("the", "ART"), new Word("block.", "N"));
esen003 = new Array(new Word("The", "ART"), new Word("poodle", "N"), new Word("ran", "V"), new Word("away.", "ADV"));
esen004 = new Array(new Word("The", "ART"), new Word("dinosaurs", "N"), new Word("lived", "V"), new Word("before", "PREP"), new Word("man.", "N"));
esen005 = new Array(new Word("Bill", "N"), new Word("and", "CONJ"), new Word("Ted", "N"), new Word("are", "V"), new Word("on", "PREP"), new Word("an", "ART"), new Word("excellent", "ADJ"), new Word("adventure.", "N"));
esen006 = new Array(new Word("People", "N"), new Word("learn", "V"), new Word("from", "PREP"), new Word("their", "ADJ"), new Word("mistakes.", "N"));
esen007 = new Array(new Word("The", "ART"), new Word("police", "ADJ"), new Word("officer", "N"), new Word("often", "ADV"), new Word("eats", "V"), new Word("donuts.", "N"));
esen008 = new Array(new Word("Sam", "N"), new Word("told", "V"), new Word("them", "PRO"), new Word("two", "ADJ"), new Word("jokes.", "N"));
esen009 = new Array(new Word("Bob", "N"), new Word("and", "CONJ"), new Word("Jim", "N"), new Word("play", "V"), new Word("golf", "N"), new Word("together.", "ADV"));
esen010 = new Array(new Word("I", "PRO"), new Word("am", "V"), new Word("Sparticus.", "N"));
esen011 = new Array(new Word("Julia", "N"), new Word("and", "CONJ"), new Word("Jules", "N"), new Word("are", "V"), new Word("brother", "N"), new Word("and", "CONJ"), new Word("sister.", "N"));
esen012 = new Array(new Word("Rainy", "ADJ"), new Word("days", "N"), new Word("make", "V"), new Word("me", "PRO"), new Word("sad", "ADJ"), new Word("and", "CONJ"), new Word("depressed.", "ADJ"));
esen013 = new Array(new Word("Harry", "N"), new Word("has", "V"), new Word("a", "ART"), new Word("magic", "ADJ"), new Word("wand.", "N"));
esen014 = new Array(new Word("Stop,", "V"), new Word("look,", "V"), new Word("and", "CONJ"), new Word("listen", "V"), new Word("before", "PREP"), new Word("you", "PRO"), new Word("decide.", "V"));
esen015 = new Array(new Word("Greg", "N"), new Word("likes", "V"), new Word("pie.", "N"));
esen016 = new Array(new Word("We", "PRO"), new Word("climbed", "V"), new Word("the", "ART"), new Word("mountain", "N"), new Word("quickly.", "ADV"));
esen017 = new Array(new Word("Everyone", "PRO"), new Word("loves", "V"), new Word("a", "ADJ"), new Word("compliment.", "N"));
esen018 = new Array(new Word("Grammar", "N"), new Word("Ninja", "N"), new Word("is", "V"), new Word("not", "ADJ"), new Word("very", "ADV"), new Word("easy.", "ADJ"));
esen019 = new Array(new Word("My", "ADJ"), new Word("dog", "N"), new Word("ate", "V"), new Word("my", "ADJ"), new Word("homework.", "N"));
esen020 = new Array(new Word("Rocks", "N"), new Word("are", "V"), new Word("hard.", "ADJ"));
easy_array.push(esen001);
easy_array.push(esen002);
easy_array.push(esen003);
easy_array.push(esen004);
easy_array.push(esen005);
easy_array.push(esen006);
easy_array.push(esen007);
easy_array.push(esen008);
easy_array.push(esen009);
easy_array.push(esen010);
easy_array.push(esen011);
easy_array.push(esen012);
easy_array.push(esen013);
easy_array.push(esen014);
easy_array.push(esen015);
easy_array.push(esen016);
easy_array.push(esen017);
easy_array.push(esen018);
easy_array.push(esen019);
easy_array.push(esen020);
medium_array = new Array();
msen001 = new Array(new Word("The", "ART"), new Word("skinny", "ADJ"), new Word("brown", "ADJ"), new Word("squirrel", "N"), new Word("ran", "V"), new Word("over", "PREP"), new Word("the", "ART"), new Word("broken", "ADJ"), new Word("fence.", "N"));
msen002 = new Array(new Word("Ben", "N"), new Word("and", "CONJ"), new Word("Jill", "N"), new Word("went", "V"), new Word("to", "PREP"), new Word("the", "ART"), new Word("moon", "N"), new Word("to", "PREP"), new Word("find", "V"), new Word("cheese.", "N"));
msen003 = new Array(new Word("Steven", "N"), new Word("often", "ADV"), new Word("sleeps", "V"), new Word("during", "PREP"), new Word("English", "ADJ"), new Word("class.", "N"));
msen004 = new Array(new Word("The", "ART"), new Word("blue", "ADJ"), new Word("dress", "N"), new Word("is", "V"), new Word("prettier", "ADJ"), new Word("than", "PREP"), new Word("the", "ART"), new Word("green", "ADJ"), new Word("dress.", "N"));
msen005 = new Array(new Word("At", "PREP"), new Word("noon,", "N"), new Word("the", "ART"), new Word("lunch", "ADJ"), new Word("bell", "N"), new Word("will", "ADV"), new Word("ring.", "V"));
msen006 = new Array(new Word("One", "ADJ"), new Word("slice", "N"), new Word("of", "PREP"), new Word("pecan", "ADJ"), new Word("pie", "N"), new Word("fills", "V"), new Word("me", "PRO"), new Word("up.", "ADV"));
msen007 = new Array(new Word("George", "N"), new Word("Washington", "N"), new Word("was", "V"), new Word("the", "ART"), new Word("first", "ADJ"), new Word("president", "N"), new Word("of", "PREP"), new Word("the", "ART"), new Word("United", "N"), new Word("States.", "N"));
msen008 = new Array(new Word("Sally", "N"), new Word("loves", "V"), new Word("James", "N"), new Word("and", "CONJ"), new Word("writes", "V"), new Word("love", "ADJ"), new Word("notes", "N"), new Word("to", "PREP"), new Word("him", "PRO"), new Word("often.", "ADV"));
msen009 = new Array(new Word("She", "PRO"), new Word("and", "CONJ"), new Word("her", "ADJ"), new Word("friend", "N"), new Word("live", "V"), new Word("in", "PREP"), new Word("a", "ART"), new Word("cave", "N"), new Word("during", "PREP"), new Word("the", "ART"), new Word("summer.", "N"));
msen010 = new Array(new Word("Sunshine", "N"), new Word("on", "PREP"), new Word("my", "ADJ"), new Word("shoulders", "N"), new Word("makes", "V"), new Word("me", "PRO"), new Word("happy", "ADJ"), new Word("most", "ADV"), new Word("of", "PREP"), new Word("the", "ART"), new Word("time.", "N"));
msen011 = new Array(new Word("They", "PRO"), new Word("sat", "V"), new Word("under", "PREP"), new Word("the", "ART"), new Word("tree", "N"), new Word("and", "CONJ"), new Word("ate", "V"), new Word("strawberries.", "N"));
msen012 = new Array(new Word("Some", "ADJ"), new Word("parents", "N"), new Word("work", "V"), new Word("more", "ADV"), new Word("than", "PREP"), new Word("two", "ADJ"), new Word("jobs.", "N"));
msen013 = new Array(new Word("There", "PRO"), new Word("is", "V"), new Word("never", "ADV"), new Word("any", "ADJ"), new Word("food", "N"), new Word("in", "PREP"), new Word("the", "ART"), new Word("house.", "N"));
msen014 = new Array(new Word("I", "PRO"), new Word("do", "V"), new Word("not", "ADV"), new Word("like", "V"), new Word("green", "ADJ"), new Word("eggs", "N"), new Word("and", "CONJ"), new Word("ham.", "N"));
msen015 = new Array(new Word("I", "PRO"), new Word("really", "ADV"), new Word("want", "V"), new Word("to", "PREP"), new Word("play", "V"), new Word("Snowboard", "N"), new Word("Kids.", "N"));
msen016 = new Array(new Word("I", "PRO"), new Word("usually", "ADV"), new Word("eat", "V"), new Word("peanut", "ADJ"), new Word("butter", "N"), new Word("and", "CONJ"), new Word("jelly", "N"), new Word("on", "PREP"), new Word("Tuesdays.", "N"));
medium_array.push(msen001);
medium_array.push(msen002);
medium_array.push(msen003);
medium_array.push(msen004);
medium_array.push(msen005);
medium_array.push(msen006);
medium_array.push(msen007);
medium_array.push(msen008);
medium_array.push(msen009);
medium_array.push(msen010);
medium_array.push(msen011);
medium_array.push(msen012);
medium_array.push(msen013);
medium_array.push(msen014);
medium_array.push(msen015);
medium_array.push(msen016);
hard_array = new Array();
hsen001 = new Array(new Word("This", "PRO"), new Word("is", "V"), new Word("a", "ART"), new Word("particularly", "ADV"), new Word("hard", "ADJ"), new Word("sentence", "N"), new Word("to", "PREP"), new Word("define", "V"), new Word("because", "CONJ"), new Word("I", "PRO"), new Word("might", "ADV"), new Word("have", "V"), new Word("labeled", "V"), new Word("some", "ADJ"), new Word("words", "N"), new Word("incorrectly!", "ADV"));
hsen002 = new Array(new Word("I", "PRO"), new Word("refuse", "V"), new Word("to", "PREP"), new Word("listen", "V"), new Word("to", "PREP"), new Word("them", "PRO"), new Word("and", "CONJ"), new Word("will", "V"), new Word("not", "ADV"), new Word("allow", "V"), new Word("them", "PRO"), new Word("to", "PREP"), new Word("control", "V"), new Word("me.", "PRO"));
hsen003 = new Array(new Word("On", "PREP"), new Word("Wednesdays,", "N"), new Word("I", "PRO"), new Word("walk", "V"), new Word("three", "ADJ"), new Word("miles", "N"), new Word("to", "PREP"), new Word("the", "ART"), new Word("movie", "ADJ"), new Word("theater.", "N"));
hsen004 = new Array(new Word("You", "PRO"), new Word("won", "V"), new Word("a", "ART"), new Word("trip", "N"), new Word("to", "PREP"), new Word("Alaska", "N"), new Word("but", "CONJ"), new Word("have", "V"), new Word("only", "ADV"), new Word("three", "ADJ"), new Word("weeks", "N"), new Word("to", "PREP"), new Word("go!", "V"));
hsen005 = new Array(new Word("Sonia", "N"), new Word("or", "CONJ"), new Word("Karen", "N"), new Word("will", "V"), new Word("babysit", "V"), new Word("their", "ADJ"), new Word("sister", "N"), new Word("after", "PREP"), new Word("school", "N"), new Word("today.", "N"));
hsen006 = new Array(new Word("Under", "PREP"), new Word("the", "ART"), new Word("tall", "ADJ"), new Word("tree", "N"), new Word("on", "PREP"), new Word("our", "ADJ"), new Word("front", "ADJ"), new Word("lawn,", "N"), new Word("a", "ART"), new Word("bird", "N"), new Word("found", "V"), new Word("a", "ART"), new Word("worm", "N"), new Word("in", "PREP"), new Word("the", "ART"), new Word("ground", "N"), new Word("and", "CONJ"), new Word("flew", "V"), new Word("with", "PREP"), new Word("it", "PRO"), new Word("to", "PREP"), new Word("its", "ADJ"), new Word("nest", "N"), new Word("above", "PREP"), new Word("the", "ART"), new Word("bushes.", "N"));
hsen007 = new Array(new Word("The", "ART"), new Word("desert", "N"), new Word("was", "V"), new Word("so", "ADV"), new Word("hot", "ADJ"), new Word("and", "CONJ"), new Word("desolate,", "ADJ"), new Word("but", "CONJ"), new Word("we", "PRO"), new Word("had", "V"), new Word("plenty", "ADJ"), new Word("of", "PREP"), new Word("water", "N"), new Word("with", "PREP"), new Word("us", "PRO"), new Word("to", "PREP"), new Word("survive.", "V"));
hsen008 = new Array(new Word("She", "PRO"), new Word("came", "V"), new Word("to", "PREP"), new Word("the", "ART"), new Word("baseball", "ADJ"), new Word("game", "N"), new Word("and", "CONJ"), new Word("cheered", "V"), new Word("for", "PREP"), new Word("our", "ADJ"), new Word("team.", "N"), new Word("However,", "CONJ"), new Word("they", "PRO"), new Word("still", "ADV"), new Word("lost", "V"), new Word("to", "PREP"), new Word("our", "ADJ"), new Word("rivals.", "N"));
hsen009 = new Array(new Word("The", "ART"), new Word("battleships", "N"), new Word("raced", "V"), new Word("over", "PREP"), new Word("the", "ART"), new Word("sea", "N"), new Word("like", "PREP"), new Word("a", "ART"), new Word("school", "N"), new Word("of", "PREP"), new Word("hunting", "ADJ"), new Word("sharks", "N"), new Word("in", "PREP"), new Word("search", "N"), new Word("of", "PREP"), new Word("their", "ADJ"), new Word("prey.", "N"));
hsen010 = new Array(new Word("Last", "ADJ"), new Word("night,", "N"), new Word("the", "ART"), new Word("moon", "N"), new Word("shone", "V"), new Word("brightly", "ADV"), new Word("over", "PREP"), new Word("the", "ART"), new Word("homes", "N"), new Word("in", "PREP"), new Word("my", "ADJ"), new Word("neighborhood.", "N"));
hsen011 = new Array(new Word("Teachers", "N"), new Word("are", "V"), new Word("wrong", "ADJ"), new Word("all", "PREP"), new Word("the", "ART"), new Word("time;", "N"), new Word("that", "PREP"), new Word("is", "V"), new Word("why", "ADJ"), new Word("they", "PRO"), new Word("do", "V"), new Word("not", "ADV"), new Word("have", "V"), new Word("proper", "ADJ"), new Word("jobs.", "N"));
hsen012 = new Array(new Word("Why", "ADV"), new Word("is", "V"), new Word("a", "ART"), new Word("viola", "N"), new Word("better", "ADJ"), new Word("than", "PREP"), new Word("a", "ART"), new Word("violin?", "N"), new Word("A", "ART"), new Word("viola", "N"), new Word("burns", "V"), new Word("longer.", "ADV"));
hard_array.push(hsen001);
hard_array.push(hsen002);
hard_array.push(hsen003);
hard_array.push(hsen004);
hard_array.push(hsen005);
hard_array.push(hsen006);
hard_array.push(hsen007);
hard_array.push(hsen008);
hard_array.push(hsen009);
hard_array.push(hsen010);
hard_array.push(hsen011);
hard_array.push(hsen012);
sentences_array = new Array();
grammarBox_array = new Array();
ninjaStar_array = new Array();
correct_array = new Array();
wrong_array = new Array();
scribbleListener = new Object();
var textBoxNum = 0;
var instructedPOS = "unknown";
var instructText = "unknown";
var explainationText = "No explaination available";
var instructedPOSNum = -1;
var totalGameTime = 0;
var gameDifficulty = "unknown";
var errorsNum = 0;
var gameQNum = -1;
var easyQNum = 10;
var mediumQNum = 10;
var hardQNum = 10;
var nounNum = 0;
var verbNum = 0;
var pronounNum = 0;
var adjectiveNum = 0;
var adverbNum = 0;
var prepositionNum = 0;
var conjunctionNum = 0;
var interjectionNum = 0;
var articleNum = 0;
var nounExpl = "A noun is a person, place, thing, or idea.\rExamples: ninja, school, teacher, grammar, honor";
var verbExpl = "A verb describes an action or state of being.\rExamples: run, jump, hide, is, am, are, was";
var pronounExpl = "Pronouns are used to replace nouns in a sentence.\rExamples: I, me, he, she, you, they, them";
var adjectiveExpl = "An adjective describes a noun or pronoun.\rExamples: black, heavy, fast, short, pointy, tasty";
var adverbExpl = "An adverb describes verbs, adjectives, or other adverbs.\rExamples: quickly, intelligiently, well, here, everywhere";
var prepositionExpl = "Prepositions begin a group of words that describe a noun, pronoun, or verb.\rExamples: on, in, by, with, under, through, at";
var conjunctionExpl = "A conjunction joins two words, groups of words, or sentences together.\rExamples: but, so, and, because, or";
var interjectionExpl = "An interjection ususally stands alone and expresses emotion or surprise.\rExamples: Ouch!, Hello!, Huh?, What!?, Haha!";
var articleExpl = "An article is used to introduce a noun. They are very easy to recognize because there are only three: a, an, the";
ninjastar1_sound = new Sound();
ninjastar1_sound.attachSound("ninjastar1");
ninjastar2_sound = new Sound();
ninjastar2_sound.attachSound("ninjastar2");
ninjastar3_sound = new Sound();
ninjastar3_sound.attachSound("ninjastar3");
starhit_sound = new Sound();
starhit_sound.attachSound("starhit");
explosion1_sound = new Sound();
explosion1_sound.attachSound("expl-close1");
explosion2_sound = new Sound();
explosion2_sound.attachSound("expl-close2");
explosion3_sound = new Sound();
explosion3_sound.attachSound("expl-close3");
wrong_sound = new Sound();
wrong_sound.attachSound("wrong");
right_sound = new Sound();
right_sound.attachSound("right");
this.attachMovie("attachMeClip", "scribbleLayer", 1);
this.attachMovie("attachMeClip", "GBLayer", 3);
this.attachMovie("attachMeClip", "correctLayer", 5);
this.attachMovie("attachMeClip", "wrongLayer", 6);
this.attachMovie("userInterface", "UI", 7);
UI._visible = false;
UI.eraseButton.onRelease = clearScribble;
this.attachMovie("attachMeClip", "starLayer", 8);
this.attachMovie("helpPanel", "myHelpPanel", 9);
myHelpPanel._visible = false;
this.attachMovie("attachMeClip", "cutsceneLayer", 10);
this.attachMovie("boarder", "THEBOARDER", 11);
addCutscene("difficultymenu");
scribbleListener.onMouseDown = function () {
scribbleLayer.lineStyle(3, 0, 100);
scribbleLayer.moveTo(scribbleLayer._xmouse, scribbleLayer._ymouse);
scribbleListener.onMouseMove = scribble;
};
scribbleListener.onMouseUp = function () {
scribbleListener.onMouseMove = undefined;
};
UI.help_clip.onRollOver = function () {
_root.myHelpPanel._visible = true;
_root.myHelpPanel.help_txt.text = _root.explainationText;
};
UI.help_clip.onRollOut = function () {
_root.myHelpPanel._visible = false;
};
Symbol 1 MovieClip [grambox] Frame 1
#initclip 3
Object.registerClass("grambox", GrammarBox);
#endinitclip
Symbol 15 MovieClip Frame 1
_root.stop();
this.stop();
this.onEnterFrame = function () {
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded < 100) {
begin._xscale = PercentLoaded;
} else {
_root.gotoAndStop("title");
}
};
Symbol 20 MovieClip Frame 1
gotoAndPlay(1 + random(40));
Symbol 211 MovieClip [__Packages.GrammarBox] Frame 0
class GrammarBox extends MovieClip
{
var myWord, myTF, attachMovie, myTextBox, createTextField, m, clicked, _x, _y, myBackground, _name;
function GrammarBox () {
super();
}
function init(pWord, pBackground) {
if (pWord == undefined) {
trace("Error: no parameters for GrammarBox object");
}
myWord = pWord;
myTF = new TextFormat();
myTF.size = 48;
attachMovie(pBackground, "myBackground", 1);
myTextBox = createTextField("myTextBox", 2, 0, 0, 0, 0);
myTextBox.autoSize = true;
myTextBox.text = myWord.getWord();
myTextBox.setTextFormat(myTF);
m = 1.2;
clicked = false;
resizeBackground();
}
function onRelease() {
if (_root.GBClicked == undefined) {
trace("ERROR: _root.GBClicked function undefined");
} else {
_root.GBClicked(this);
}
clicked = true;
}
function getClicked() {
return(clicked);
}
function getPOS() {
return(myWord.getPOS());
}
function getPartOfSpeech() {
return(myWord.getPartOfSpeech());
}
function setPosition(px, py) {
_x = px;
_y = py;
}
function getFontSize() {
return(myTF.size);
}
function resizeText(fontsize) {
myTF.size = fontsize;
myTextBox.setTextFormat(myTF);
resizeBackground();
}
function setBackground(pBackground) {
attachMovie(pBackground, "myBackground", 1);
resizeBackground();
}
function resizeBackground() {
myBackground._width = myTextBox._width * m;
myBackground._height = myTextBox._height;
myTextBox._x = Math.abs(myBackground._width - myTextBox._width) / 2;
}
function resizeBGD(px, py) {
myBackground._width = (myTextBox._width * m) * px;
myBackground._height = myTextBox._height * py;
myBackground._x = myTextBox._x - (Math.abs(myBackground._width - myTextBox._width) / 2);
myBackground._y = myTextBox._y - (Math.abs(myBackground._height - myTextBox._height) / 2);
}
function setColor(hex) {
myTF.color = hex;
myTextBox.setTextFormat(myTF);
}
function toString() {
return("Grammar Box: " + _name);
}
}
Symbol 212 MovieClip [__Packages.Word] Frame 0
class Word
{
var myword, myPOS, myPartOfSpeech;
function Word (param_myword, param_myPOS) {
myword = param_myword;
myPOS = param_myPOS;
setPartOfSpeech();
if (((((((((param_myPOS != "N") && (param_myPOS != "V")) && (param_myPOS != "PRO")) && (param_myPOS != "ADJ")) && (param_myPOS != "ADV")) && (param_myPOS != "PREP")) && (param_myPOS != "CONJ")) && (param_myPOS != "INT")) && (param_myPOS != "ART")) {
trace("ERROR: Invalid part of speech in " + this);
}
}
function getWord() {
return(myword);
}
function getPOS() {
return(myPOS);
}
function getPartOfSpeech() {
return(myPartOfSpeech);
}
function setWord(newWord) {
myword = newWord;
}
function setPOS(newPOS) {
myPOS = newPOS;
}
function setPartOfSpeech() {
if (myPOS == "N") {
myPartOfSpeech = "Noun";
} else if (myPOS == "V") {
myPartOfSpeech = "Verb";
} else if (myPOS == "PRO") {
myPartOfSpeech = "Pronoun";
} else if (myPOS == "ADJ") {
myPartOfSpeech = "Adjective";
} else if (myPOS == "ADV") {
myPartOfSpeech = "Adverb";
} else if (myPOS == "PREP") {
myPartOfSpeech = "Preposition";
} else if (myPOS == "CONJ") {
myPartOfSpeech = "Conjunction";
} else if (myPOS == "INT") {
myPartOfSpeech = "Interjection";
} else if (myPOS == "ART") {
myPartOfSpeech = "Article";
} else {
myPartOfSpeech = "ERROR";
}
}
function toString() {
return((("Word: " + myword) + ", PoS: ") + myPOS);
}
}
Symbol 34 MovieClip [starthrow] Frame 6
_root.starhit_sound.start(0.015, 0);
Symbol 34 MovieClip [starthrow] Frame 10
stop();
Symbol 36 MovieClip [correct] Frame 1
this._visible = false;
Symbol 36 MovieClip [correct] Frame 13
this._visible = true;
_root.right_sound.start(0, 0);
Symbol 36 MovieClip [correct] Frame 30
stop();
_root.advance();
Symbol 46 MovieClip [wrongClip] Frame 1
this._visible = false;
Symbol 46 MovieClip [wrongClip] Frame 12
this._visible = true;
this.myGB.setBackground("scorch");
this.myGB.resizeBGD(1.5, 1.5);
this.myGB.setColor(16777215);
soundNum = random(3);
if (soundNum == 0) {
_root.explosion1_sound.stop();
_root.explosion1_sound.start(0, 0);
} else if (soundNum == 1) {
_root.explosion2_sound.stop();
_root.explosion2_sound.start(0, 0);
} else {
_root.explosion3_sound.stop();
_root.explosion3_sound.start(0, 0);
}
Symbol 46 MovieClip [wrongClip] Frame 28
stop();
_root.wrong_sound.start(0, 0);
_root.wrongComplete(this.myGB.getPartOfSpeech());
Symbol 70 Button
on (release) {
_root.addIntro("easy");
}
Symbol 72 Button
on (release) {
_root.addIntro("hard");
}
Symbol 74 Button
on (release) {
_root.addIntro("medium");
}
Symbol 77 MovieClip [difficultymenu] Frame 1
Symbol 86 Button
on (release) {
_root.gotoAndStop("title");
this.removeMovieClip();
}
Symbol 100 MovieClip [score] Frame 1
cont_button._visible = false;
Symbol 100 MovieClip [score] Frame 10
_root.ninjastar1_sound.start(0.055, 0);
Symbol 100 MovieClip [score] Frame 40
_root.ninjastar2_sound.start(0.04, 0);
Symbol 100 MovieClip [score] Frame 70
stop();
rankPic._visible = true;
cont_button._visible = true;
_root.ninjastar3_sound.start(0.15, 0);
Symbol 115 MovieClip Frame 1
stop();
Symbol 135 MovieClip [intro] Frame 1
stopAllSounds();
s = new Sound();
s.setVolume(100);
Symbol 135 MovieClip [intro] Frame 185
_root.startGame(this.d);
_root.removeCutscene();
Symbol 144 Button
on (release) {
_root.fadeThemesong();
_root.gotoAndStop("main");
}
Symbol 146 Button
on (release) {
_root.gotoAndStop("how to play");
}
Symbol 148 Button
on (release) {
stopAllSounds();
_root.gotoAndStop("credits");
}
Symbol 161 Button
on (release) {
_root.gotoAndStop("title");
}
Symbol 164 Button
on (release) {
play();
}
Symbol 169 MovieClip Frame 1
Symbol 199 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 2
stop();
Symbol 199 MovieClip Frame 12
stop();
Symbol 199 MovieClip Frame 13
stop();
Symbol 199 MovieClip Frame 23
stop();
Symbol 199 MovieClip Frame 33
stop();
Symbol 199 MovieClip Frame 43
stop();
Symbol 199 MovieClip Frame 53
stop();
Symbol 199 MovieClip Frame 63
stop();
Symbol 199 MovieClip Frame 73
stop();
Symbol 199 MovieClip Frame 83
stop();
Symbol 199 MovieClip Frame 93
stop();
Symbol 199 MovieClip Frame 103
stop();
Symbol 199 MovieClip Frame 113
stop();
Symbol 208 MovieClip Frame 1
credits_sound = new Sound();
credits_sound.attachSound("results");
credits_sound.start(0, 0);