How do I make a menu (not level select)?

0 favourites
  • 8 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Trying to make an action menu pop up on click, but it's a little broken. I couldn't find any current posts on this type of menu - if there is, please point me to it.

    www -dot- cazualnoob -dot- com/web-games/ (second game file)

    I know the gridx and gridy are switched on create object menu1, but if they're "correct" the menu doesn't show. I'm at a loss.

    Looking for:

    Why the menu isn't popping up at the origin of the mouse.

    Why clicking the menu (to destroy) pops up another menu instantly.

    Best way to make trees solid. Not sure how to handle this in tilemapping (guessing just create an invisible solid sprite).

    Any advice or best practices for what I'm doing.

    Any help would be appreciated... still working on the learning curve.

  • You're creating the menu at gridx,grixy instead of mousex,mousey

    When you create at mousex,mousey you have an event that destroys on touch so you'll never see the menu. You should set up a boolean for opened/closed and trigger the pop up in that way.

    If by solid you mean 'has collision', they already do, unless you erase the tree tiles. It really depends what you mean by solid in this situation and what you want the trees to do.

  • Old school example from the "How do I FAQ"

    [quote:1ttjgtwp]Do a contextual menu in events - LINK

  • Old school example from the "https://www.scirra.com/forum/how-do-i-frequently-asked-questions_t63692 How do I FAQ"

    [quote:3bzrqz45]Do a contextual menu in events - scirra.com/forum/context-menus-in-game_topic45453.html LINK

    Yea, I saw that from my searching before hand, but I couldn't get it to work in my construct - I was just assuming the version wasn't compatible being 5 years old or me using the free version until I get farther in learning.

    You're creating the menu at gridx,grixy instead of mousex,mousey

    When you create at mousex,mousey you have an event that destroys on touch so you'll never see the menu. You should set up a boolean for opened/closed and trigger the pop up in that way.

    If by solid you mean 'has collision', they already do, unless you erase the tree tiles. It really depends what you mean by solid in this situation and what you want the trees to do.

    OK, thanks. I'll work on that angle for the menu.

    Solid meaning can't pass through (behavior - solid), right now the main char (arrow keys) can pass through the tree tiles. I suppose sprites are the only way to do that.

  • I did it. Thanks for the guidance.

  • Suppose that works. Although it is a bit weird.

    1/ plinkie suggested a Boolean. A boolean is type of instance variable. If you gonna create a global variable 4 everything, you will (seriously) end up with a no manageable project. Moment you have 2 types of menus, you gonna be lost.

    2/ This add 1 to menuopen thingie. I know why you did that. But the good practise way to do this, is just using 'else' in event 15.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The capx did work, but it required some adjustements.

    Here is a version made in r237 that does the job : ContextualMenu_2016.capx

  • Right, I should have specified on how it wasn't working. I ran it in chrome, IE, and firefox and all I see is a big gray empty box that does nothing even when I click.

    I even opted-in and downloaded the beta to open the newest one and it's the same.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)