I think to ask my game problem in this forum please helping me to show the answer of my game random and I’m quite confusing with the random thing. I want to achieve random scenes based on director function.
I created 3 objects: square, rectangle, and circle. Each object I placed it into each file such as; game1.lua = square, game2.lua = rectangle, and game3.lua = circle.
My point is I want to display the objects one by one randomly based on the separate files that I’ve created, ex: (game2, game1, game3), if starting with game2 and after the answer is right then it will jump to the next game and so on… [import]uid: 64917 topic_id: 11621 reply_id: 311621[/import]
help please… [import]uid: 64917 topic_id: 11621 reply_id: 42244[/import]
I’m a little unclear on what you are asking; was this just a longer way of saying that when one level is complete you then want to switch to a random level?
Peach
EDIT: Do NOT create dupes and then proceed to bump both. Read the forum rules before posting again.
http://developer.anscamobile.com/forum/2011/05/05/forum-rules-and-guidelines [import]uid: 52491 topic_id: 11621 reply_id: 42271[/import]
Sorry for the dupe pages peach, it won’t happen again.
I mean when the game start and it will directly random the 3 levels, based on the 3 files that I’ve created(square, rectangle, and circle).
And I have problem disposing the random level because random will create duplicate of the previous object in another level and how to create the function that will detect if the object that already appeared and it won’t appear again in second and third game?? [import]uid: 64917 topic_id: 11621 reply_id: 42351[/import]
You’ll want to use a global variable (global because you’re using director) to state which scenes have already been played.
[lua]_G.myvariable = true[/lua]
That’s the best way to set a global using director, from my experience.
Peach [import]uid: 52491 topic_id: 11621 reply_id: 42390[/import]