-
[F8-Game: Appearance of the 3 items(objects) should be equal.]
Hi,
i am working on one game where Appearance of the 3 items(objects) should be equal.
this is the code of one of the level:
PHP Code:
if (Level>=11 && Level<=15) {
if (damage_items>=20) {
trace("Game Over");
gotoAndStop("end");
pop_msg._visible = false;
pop_go._visible = true;
pop_go.gotoAndStop("game_over");
} else if (damage_servants>=15) {
trace("Game Over");
gotoAndStop("end");
pop_msg._visible = false;
pop_go._visible = true;
pop_go.gotoAndStop("game_over");
} else if (damage_gajju>=2) {
trace("Game Over");
gotoAndStop("end");
pop_msg._visible = false;
pop_go._visible = true;
pop_go.gotoAndStop("game_over");
}
temp_total_level_time = (total_level_time-5000);
//trace("temp_total_level_time :::"+temp_total_level_time);
if (bonus1) {
temp_total_level_time = temp_total_level_time+10000;
total_level_time += 10000;
//trace("temp_total_level_time :::"+temp_total_level_time);
//trace("After True level_timer :::"+level_timer);
bonus1 = false;
}
if (start_level_time<=temp_total_level_time) {
start_popup_time++;
start_level_time = getTimer();
level_timer = temp_total_level_time-start_level_time;
timer_txt.text = Math.round(level_timer/1000);
temp_foodnumb = random(total_food.length);
temp_ledge = random(empty_list.length);
ran_popupitems = Math.round(5*Math.random());
if (ran_popupitems == 0) {
this["l"+empty_list[temp_ledge]].foodname = this["food"+total_food[temp_foodnumb]];
}
if (ran_popupitems == 1) {
var item_ran:Number = Math.random(2*Math.random());
if (item_ran == 0) {
this["l"+empty_list[temp_ledge]].foodname = this["item"+total_items[0]];
}
if (item_ran == 1) {
this["l"+empty_list[temp_ledge]].foodname = this["item"+total_items[2]];
}
}
if (ran_popupitems == 2) {
this["l"+empty_list[temp_ledge]].foodname = this["servant"+total_servants[0]];
}
if (ran_popupitems == 3) {
this["l"+empty_list[temp_ledge]].foodname = gajju;
gajjucount++;
if (gajjucount>1) {
this["l"+empty_list[temp_ledge]].foodname = this["food"+total_food[temp_foodnumb]];
}
}
if (ran_popupitems == 4) {
bo_ran = Math.round(2*Math.random());
if (bo_ran == 0) {
this["l"+empty_list[temp_ledge]].foodname = this["b"+total_bonus[0]];
}
if (bo_ran == 1) {
this["l"+empty_list[temp_ledge]].foodname = this["b"+total_bonus[1]];
b2count++;
if (b2count>1) {
this["l"+empty_list[temp_ledge]].foodname = this["food"+total_food[temp_foodnumb]];
}
}
}
if (start_popup_time>=total_popup_time) {
this["l"+empty_list[temp_ledge]].total_time_on_ledge = 30;
this["l"+empty_list[temp_ledge]].alive = true;
this["l"+empty_list[temp_ledge]].active = true;
start_popup_time = 0;
total_popup_time = randRange(2, 3)*10;
} else {
// do nothing.. just increase counter
}
} else {
for (i=0; i<total_ledge.length; i++) {
this["l"+(i+1)]._visible = false;
this["food"+(i+1)]._visible = false;
this["item"+(i+1)]._visible = false;
this["servant"+(i+1)]._visible = false;
this["b"+(i+1)]._visible = false;
this["food"+(i+1)].gotoAndStop(1);
this["item"+(i+1)].gotoAndStop(1);
this["servant"+(i+1)].gotoAndStop(1);
}
//ran_popupitems = undefined;
b2count = 0;
itemcount = 0;
servantcount = 0;
Ledges_selectedfor_this_level = [];
empty_list = [];
//_root.bonus1 = 0;
temp_total_level_time = 0;
temp_total_ledge = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18];
ghattu._visible = false;
gotoAndStop("end");
pop_msg._visible = true;
pop_go._visible = false;
pop_msg.gotoAndStop("level_complete");
}
}
(\___/)
(0" "0)
( <> )
(")__(")
-
Senior Member
Oh. Well that's good to know
-
in the end the question is propably something like "can someone fix the code?"
but there is still missing almost everything that describes what you want
-
Senior Member
Like what are the items and how are they being unequal?
-
....he's amazing!!!
Ahhh, I think he's spawning three different items randomly and they're not appearing in equal quantity. Took a while to decipher.
It appears to be spawning the food object twice as much as the servant and item objects.
-
Senior Member
Wow, you crazy cats solving questions that are not even asked. I gotta paste in a picture of some cancer cells in a pitri dish along with a post that says "One of these things is not like the other, one of these things just doesn't belong". You guys would run off and solve CANCER!!!
Might have to put the pitri dish in ascii art though...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|