Changing attribute values before entering particular level

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
edited November -1 in Working with GS (Mac)
Hi, I'm still working through examples, tests, experiments, etc; but for interest, have decided to narrow these down to be relevant to a specific first game app i'll be making. I guess it's best to solve "real-world" gaming problems as they occur...

So I'm working on menus. My first app will be based on the good ol' pairs type (but with a slight twist, theme, and a few more "bells and whistles" than usual, hopefully). So for each level, I'll have the backs of my items, as well as what they'll be hiding, out of screen, waiting to be placed in a choice of x,y positions, in random (so each time the total game is replayed, the order will be different every time).

OK: Rules are triggered by key/mouse press or touch of an actor. This surely is the only way to get things happening. So if a user clicks a New Game button, I would want Level 1 to appear (naturally!) but before it does, for the objects to be in place in their random positions. (I'm still working on multiple random placings; think I've worked out a simpler way to do this but haven't put it into practice yet. So no worries there, as such). I can't put the random placement "code" in the button before I tell it to go to level 1, as there doesn't seem to be any way to "communicate" this info to apply to another level i.e example: in menu level, button actor "script", move actor suchandsuch on level 1 to wherever.

Nor can that be put after "go to level 1", for the same reason as there doesn't seem to be any way of doing that; plus even if there was, it wouldn't execute properly, I guess, as it would go to the next level, and "forget" anything after.

That just leaves stuff set up (in this case, random placements) after the button is pressed, and just as the level is starting. But how can I put rules in a level?

Hope I haven't been rambling too much, just trying to explain my prob the best I can.

To summarize, it could be more easily explained
like as if you were writing Basic, that I would want some sort of equivalent in GS:
on enterLevel (or on preOpenCard)
Radomize, place, etc
end enterLevel (or preOpenCard)

Any thoughts/solutions/advice gratefully received, thanks!

:-)

PS I'm practising my "d'oh!" just in case...

---------------------------------------------------------------
Spiral Gyro Games

""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Oh flippin' Nora; sorry to waste your time: I've just worked out a pretty good workaround:

    Seeing as I can't put any Rules into a Scene/Level, whatever, only Actors (as I'm quite certain I can't now), i'll put the final go to level 1 command into the Start button as usual; it'll go to Level 1, which will have an actor completely covering the screen, which will say: Level 1. That's my actor I can "code" of course, when pressed/clicked, to get the items on screen in a random order, then fade to reveal them.

    I think i'll wait a couple of hours more before posting any other questions in future... ;-)

    ---------------------------------------------------------------
    Spiral Gyro Games

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.