Tuesday, September 30, 2008

Ghost Hunt: Near Completion



Done, but i screwed it up somehow.

Almost completely revamped. Increased difficulty level, and added a second level that mirrors the trend in classic games of presenting a huge challenge to the gamer. I also added a background as well. Everything is a go, except that i have somehow produced a logic error that prevents users from advancing to level 2. I think it is just something i am over-looking, but at the moment after countless rereads and revisions, i am stumped. Any ideas?

Here is my code for advancing to level 2.

var score = 0; scorebox.text = score; function scoreIncrease() { scorebox.text = ++score; }

var scoreb = 0;
scorebox.text = scoreb;
function scoreIncrease() {
scorebox.text = ++scoreb;
}
/* This creates a variable called "score". It sets it's default value to 0 when the game
starts. The dynamic text box "scorebox" gets assigned the value, "score".
NOTE: this means that variables when asked to show up as text (.text) appears as such.

A function, "scoreIncrease()" has been created. When called, it will take the score, and
add 1 to its value. (++score.))
*/

var miss = 0;
missCount.text = miss;
function missPlus() {
missCount.text = ++miss;
scorebox.text = scoreb + 0;
}

bkg.onDragOver = function() {
msgbox.text = "(c) 2008, Napalm Justice Productions"
}

onEnterFrame = function(){ if (score >= 2){ gotoAndStop(4); } }
bkg.onRelease = function() {
missCount.text = ++miss;
}

onEnterFrame = function(){
if (miss >= 3){
gotoAndStop(5);
}
}

/* Advances game to next level, or game over screen. Here,
the game over screen is set to frame 2 of the main timeline,
and set only to show if the score is higher than 20.*/

It is set up exactly like my miss variable, but it still will not work, although you can die without problem. Any ideas on what i am doing wrong?

No comments: