So i got my menu working on my game when you complete the level but when you hit retry it will reset the scene but wont delete the menu. How could i fix this?
but my game is about an actor going thru a maze picking up objects well theres 3 per scene so i got it to where when all the objects are picked up it brings up a menu to go to next level retry or menu well if i hit retry it resets the scene but keeps my menu up on the screen with the 3 options and i dont understand why it will not go away it goes away when i hit next or menu
ive tried creating a new rule that said if objects are greater then 0 then destroy but that didnt work
Have a attribute called showMenu and have it set to 0
Now when you beat the level, collect the last thing, or whatver triggers the end of the level also have a change attribute behavior and change showMenu to 1
Then in each of your scenes have a change attribute behavior by itself changing showMenu to 0
Now have a rule in the menu when showMenu=1 move or change attribte position to wherever you want
then open up the otherwise section of that rule and have move or change attribute positions to somewhere offscreen so you cant see it.
Now ill explain for ya. The showMenu attribute is what trigers the menu to show, then the stuff you have in the otherwise section to move offscreen will tell the menu when the attribute is 0 to hide itself
Then you have your change showmenu to 1 rule when you beat the level that tells the menu to show itself
and lastly the change attribute showmenu to 0 you have at the beginign of each scene will make sure when each level starts the menu is not there
Sry it was just because I did not really understand your problem, so I wanted to check it, and then I would have posted the solution I am sorry but I thought you send me the game, that is why I wrote you the personal message
i tried doing exactly what you said and what it does is when i finish the round the menu pops up fast then goes right away before i even get a chance to even to hit retry
well i did that and it made it better like before when i would reset the scene the menu wouldnt go away at all now it goes awaay but comes back... im not sure what im doing wrong but its goes away then slides in like it does at first when i beat the level the first time
cause the inital start of the scene theres no menu just till i collect all the stuff then it comes up then it just wont go away
12vCummins said: well i did that and it made it better like before when i would reset the scene the menu wouldnt go away at all now it goes awaay but comes back... im not sure what im doing wrong but its goes away then slides in like it does at first when i beat the level the first time
cause the inital start of the scene theres no menu just till i collect all the stuff then it comes up then it just wont go away
Did you look at the demo?
There are a couple of key things:
GS starts at the bottom actor in the layer list and works its way up. But within an actor it starts at the top of the rules and works down. So notice that the lowest actor in the layers list is the rules actor and the first behavior in that actor sets the item count to zero. But remember that the rule checking for level complete is looking for an item count of zero so I have to give the game time to add up the item count in the item actors. So that is why I put the rule within a rule that checks for self.time > 1. 1 second is enough time for the game engine to load the other actors' rules which then makes the item count > 0.
So to sum it up: Be sure that your actors are placed in the scene in the correct order. Be sure that you give the game engine time to total up the items BEFORE checking if game.itemcount=0.
in the rules actor where you had the first change atributes for the item and menu set to 0 i had to set my item to 3 cause thats how many i had but its working now! thanks man!
in the rules actor where you had the first change atributes for the item and menu set to 0 i had to set my item to 3 cause thats how many i had but its working now! thanks man!
Good! Personally I like to use the method of having each item add 1 to the item total. That frees you up with level design. You could then add more items in later levels to up the difficulty and you will not have to go in and change the total somewhere else. You just let the items take care of it automatically.
but now i have another BIG problem.. my menu spawns in all different places on each level like level 1 will be centered but 2 will be way off and 3 is different from the other 2
but now i have another BIG problem.. my menu spawns in all different places on each level like level 1 will be centered but 2 will be way off and 3 is different from the other 2
Well, I would take a look at the demo I made and use a similar setup. I would put the menu offscreen and interpolate it to x 240 so it is centered in the screen (assuming landscape iPhone). I would also check that you have this menu on a non scrolling layer.
My problem with that is it doesnt show the menu centered its cented for the default scene location but when my actor moves down pretty far and complete the level and the menu pops up you can barely see it
12vCummins said: My problem with that is it doesnt show the menu centered its cented for the default scene location but when my actor moves down pretty far and complete the level and the menu pops up you can barely see it
then go into each scene and adjust where the menu is and goes too.
thats what im working on.. but the problem is theres no set finish area, but i think im gunna put in a finish line that you have to cross once all the objects are picked up then the finish line will bring up the menu but im not sure how to go about this..
Comments
difficult to understand your question
but my game is about an actor going thru a maze picking up objects well theres 3 per scene so i got it to where when all the objects are picked up it brings up a menu to go to next level retry or menu well if i hit retry it resets the scene but keeps my menu up on the screen with the 3 options and i dont understand why it will not go away it goes away when i hit next or menu
ive tried creating a new rule that said if objects are greater then 0 then destroy but that didnt work
post it on the forum so other people who have the same issue can search and find the info
Have a attribute called showMenu and have it set to 0
Now when you beat the level, collect the last thing, or whatver triggers the end of the level also have a change attribute behavior and change showMenu to 1
Then in each of your scenes have a change attribute behavior by itself changing showMenu to 0
Now have a rule in the menu when showMenu=1 move or change attribte position to wherever you want
then open up the otherwise section of that rule and have move or change attribute positions to somewhere offscreen so you cant see it.
Now ill explain for ya. The showMenu attribute is what trigers the menu to show, then the stuff you have in the otherwise section to move offscreen will tell the menu when the attribute is 0 to hide itself
Then you have your change showmenu to 1 rule when you beat the level that tells the menu to show itself
and lastly the change attribute showmenu to 0 you have at the beginign of each scene will make sure when each level starts the menu is not there
hope that helps
that is why I wrote you the personal message
Sorry....
search for: "Reset Scene With Pop Up Menu" in the new section of the GS creator start window. Hope it helps.
cause the inital start of the scene theres no menu just till i collect all the stuff then it comes up then it just wont go away
There are a couple of key things:
GS starts at the bottom actor in the layer list and works its way up. But within an actor it starts at the top of the rules and works down. So notice that the lowest actor in the layers list is the rules actor and the first behavior in that actor sets the item count to zero. But remember that the rule checking for level complete is looking for an item count of zero so I have to give the game time to add up the item count in the item actors. So that is why I put the rule within a rule that checks for self.time > 1. 1 second is enough time for the game engine to load the other actors' rules which then makes the item count > 0.
So to sum it up: Be sure that your actors are placed in the scene in the correct order. Be sure that you give the game engine time to total up the items BEFORE checking if game.itemcount=0.
good luck!
in the rules actor where you had the first change atributes for the item and menu set to 0 i had to set my item to 3 cause thats how many i had but its working now! thanks man!
but now i have another BIG problem.. my menu spawns in all different places on each level like level 1 will be centered but 2 will be way off and 3 is different from the other 2
I think i know what to do but not completly sure