How to make a complete/failed popup?

rodrigosw94rodrigosw94 Member Posts: 45
edited April 2012 in Working with GS (Mac)
Hello,

I want to make a popup in my game, when you pass the level or fail the level. Like this:



But, when failed, or completed, I want more 2 buttons in this: (Menu, Retry) or (Menu, Next Level)

Thanks to now,

Best Answers

  • PsychoticStudiosPsychoticStudios Posts: 101
    edited April 2012 Accepted Answer
    Making Buttons: For the buttons like menu or next level just add a change scene behavior to the actor of the button and specify which scene to go to. For retry just add reset scene behavior.

    Making popup: First we need to find if they failed or not. Set up your game so you can have some way to now if they win or lose so like for the video shown above, if the fish actor collides with target make win attribute true otherwise false. Something along those lines. To make the popup and buttons fly in, have the actor(s) above or to the side of the scene with a rule like... When attribute is = (number or true/false) move to/accelerate towards coordinates for center of screen (depends on your resolution).

    Hope this helps :D
    (If you need further explanation let me know because I wrote this kind of weird and hard to understand :P. It's hard to explain. )
  • gyroscopegyroscope I am here.Posts: 6,598
    edited April 2012 Accepted Answer

    Hi @rodrigosw94,

    Perhaps difficult to explain but easy to do...

    Make your two popup graphics, one showing the words Menu and Retry, and the other showing the words Menu and Next Level.

    Put them outside of the screen area.

    Add transparent actors over the areas (buttons) of the graphics showing the words Menu, Retry and Next Level.

    In their Rules (of these transparent actors), put a Constrain attribute in each, constraining their y to the appropriate graphic (presuming the popup is travelling downwards or upwards).

    Also put the appropriate Rule in each, i.e When touch is pressed, go to Menu/Next level or Reset scene.

    Put a Rule in your first graphic (the one showing the words (buttons) Menu and Retry) something like when game.Switch is true, interpolate to y position (on-screen, where you want it to stop).

    Somewhere in-game, when the user has "failed", you set game.Switch to true.

    Put a Rule in your second graphic (the one showing the words (buttons) Menu and Next Level) something like when game.Switch2 is true, interpolate to y position (on-screen, where you want it to stop).

    Somewhere in-game, when the user has "won", you set game.Switch2 to true.


    It's on those lines, I don't think I've forgotten anything - and it probably sounds more complicated than it is. Hope it makes sense for you.

    ----------------------------------------------
    http://davidgriffinapps.co.uk/

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

  • gyroscopegyroscope I am here.Posts: 6,598
    edited April 2012 Accepted Answer

    Hi, Move To is fine (I've never had problems, but others have; if you put in round numbers without fractions, it should be OK); but then Interpolate to the position you want is probably better/more reliable.

    And as long as you have your attribute "triggers" in place, they will move on-screen. (I.e when the user loses, a boolean attribute is changed to true; as long as you've put When Switch1 is true, interpolate (behaviour) to y in the graphic, it'll move then (similar with the other one).

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

  • gyroscopegyroscope I am here.Posts: 6,598
    edited April 2012 Accepted Answer

    Personally, I'd keep your popups moving into the screen with Move To or Interpolate still; I wouldn't link them to the camera.

    Interpolate is really straightforward behaviour to use with nothing to worry about! Where it says Interpolate Attribute, click on the three dots and then in the Expression Editor, click on the name of your image > Position > Y. THen where it says To, put the Y co-ordinate where you want the popup to finish on-screen. And finally, set the Duration for how long it'll take to get there (probably 1 second will be enough). :-)

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

Answers

  • rodrigosw94rodrigosw94 Member Posts: 45
    Really thanks to all replies. I'll try do this now, and post here the result.
  • rodrigosw94rodrigosw94 Member Posts: 45
    Ok, I make the two popups, they are off of the screen, all perfect, make attributes, all things. But I cant make the popups come to the screen. How can I move them? I tried move, and move to.. using positions 0 and 0, relative to scene, I tried sending then to bg position in layers.

    Can help again?
  • rodrigosw94rodrigosw94 Member Posts: 45
    I dont understand on how to use Interpolate in my case! Sorry.

    And only for explain more about my game, I have an actor, that controls the camera, can do the popup using this method too? Or have another method when an actor controls the camera?

    Because, when actor complete the level, need an popup to player choose next level or menu. But, need to appear next actor, because him control the camera.

    Sorry if confused :/
  • rodrigosw94rodrigosw94 Member Posts: 45
    Ok, using the interpolate, all works! =)

    But now, I want the popup come in the screen where actor is.

    How can I do this?
  • rodrigosw94rodrigosw94 Member Posts: 45
    For explain better, dont need to appear where actor is, but appear in the screen, where actor who control camera are now or before of complete or fail
  • rodrigosw94rodrigosw94 Member Posts: 45
    Sorry for other post, I see here, and if have a way to make the current screen back to the camera origin, popup will appear !
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Glad you got it sorted. :-)

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

  • rodrigosw94rodrigosw94 Member Posts: 45
    Can you help me in this part?
  • pinata14pinata14 Member Posts: 150
    you could do a thing with the camera which is kinda hard to explain or you could use the pause game behavior and go to the win/lose screen
  • parizpariz Member Posts: 1
    Hi everybody, I solved this by adding an Actor Spawn (for the popup elements) in the background that is synchronized with the end of the Level.
    Do you guys think this is ok or is it too much memory consuming?
    Cheers
  • patapplepatapple Member Posts: 873
    edited May 2012
    It's also ok , but it's better to use the interpolate position
  • ZoytZoyt Member Posts: 374
    If I were doing this, I would probably be using pause screen due to having to stop all interactions in the background. Just a thought.
Sign In or Register to comment.