Pause/Item/Stuff Menu

This forum is currently in read-only mode.
From the Asset Store
A well commented template with list menus and shops to use in your top-down RPGs or metroidvania games!
  • You know how in every RPG or game with RPG elements the pause menu has all the items, stats, etc? I was wondering how you'd create this. The actual creating of it isn't hard, but how to fit it into the rest of the game correctly might be.

    I was thinking I'd just create a layer with the stuff in it, but if you have lots of images in your menu, that only adds to VRAM (although you could solve this with optimization and using low res images which works in most cases). I then noticed there was a Layout Object which can put one layout in another. There's no page on the wiki about it and I'm not sure how it will work or if it can interact correctly for changing things in the game layout (eg. using an item, equipping a weapon) and be updated with current stats and all that.

    I also have the problem with the pausing of the game itself. I was just setting time scale to 0 for pausing, but I hear that would mess up sounds/music. I have no idea how to do this then or how to create a custom pause.

    Edit: I looked at the Layout Object and noticed it has its own pause setting, but that will still pause my sounds won't it? Could I create two Layout Objects, one for Music (since only music will need to carry over into the menu right?), one for the menu, then when the menu one appears, it freezes the main window but the Music Layout Object keeps playing?

  • The layout object is (I think) bugged a bit right now.

    You should be fine with a hidden/visible layer method though, and using timedelta and timescale to pause the action when the menu, inventory etc. is open.

  • Okay, but when you use Time Scale, it pauses all sounds doesn't it?

  • It still plays music if it's played like music.

  • It still plays music if it's played like music.

    Thanks. That clears that up.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is the code for my pause menu. I tried another way (using Layer 4's visibility rather than global variables) but it had the same problem. When Enter Key is Pressed, it sees 'pause' as 1 and then sets it to 0. Then it checks the next subevent and sees it as 0 and sets it back to 1! If I switch the order of those subevents, it won't pause at all because the last variable change sets 'pause' to 0. Anyone know a way to fix this? I want pressing Enter to pause when not paused, but resume when already paused.

    On Enter Key Pressed
    ---Is global variable 'pause' = 1 > Set global variable 'pause' = 0
    ---Is global variable 'pause' = 0 > Set global variable 'pause' = 1
    
    Is global variable 'pause' = 1 > Set Timescale = 0
                                              > Set Layer 4 Visible
    
    Is global variable 'pause' = 0 > Set Timescale = 1
                                              > Set Layer 4 Invisible[/code:i8ltavow]
    
    Edit: Added Else to the second subevent and it works.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)