Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Two core mechanics I'm trying to figure out

Hey guys,

So I'm completely new to flowlab and not very experienced at programming in general, and I'd appreciate your help in brainstorming ways of making two somewhat similar core mechanics of the little project I'm working on here happen.

The first one is a dynamic menu which appears if the player clicks and holds anywhere on the screen without moving the mouse and displays the icon for every relevant item of a given type from the inventory with the amount currently owned overlaid on top of each, placed in a circle around the mouse. The circle will gell bigger or smaller to accommodate the number of items displayed. Once the menu opens, everything but said menu is paused and the player can click the item(s) they want to use however many times they want to add more of a given item, press a reset button to bring the count of every selected item back to zero if they made a mistake in the selection, or press a "done" button which prompts a confirmation and if confirmed uses those items.

The second one is a grid which appears from the moment the player clicks, holds and drags the mouse on the screen. This one doesn't pause the game and it registers which grid squares the mouse passes over first, second, etc. leaving a visible trail, as well as having a "done" and a "cancel" button. Once a pattern is drawn and the done button is pressed, the game searches a database (array?) for a matching pattern and executes the corresponding function or a default function if there is no match.

I hope I'm explaining this clearly enough for you to get a clear understanding of what I'm trying to do. I'm just starting to work on these and already encountering issues since I'm not used to the tools available in this engine and to the way in which they work together yet. Right now I'm trying to figure out how to check for the press, hold and don't move the mouse condition, which I thought would be done this way but it doesn't seem to work:


Thanks in advance!


  • If you've started on the game and coding, send a link to the game so then I can see what you're talking about
  • I've only made the movement and item pick-up bits so far so there isn't much to show, but here's the link:
  • Bump - I'd like to put some time into the game this weekend so I'd really appreciate it if some experienced users could tell me how to achieve those results.

  • That click and hold thing doesn’t need a mousemove, instead use “out”

    That triggers when the mouse comes off the button
  • Ok, thanks, but I'm not sure if I understand how this works. This menu is to be displayed whenever the player clicks and holds for say 2 seconds without moving the cursor in relation to the device's screen, not to the game world, with a little buffer on each side to account for the hand trembling. This must happen no matter where he clicks, what game object happens to currently be at that position or if the character is in motion. What's that button which the mouse would be moved off of?
  • @Akninshar okay, from the way you worded that it seems like you put the button in the game world layer...

    Consider using the GUI layer, which doesn’t scroll with the world...

Sign In or Register to comment.

| make games in your browser
@ 2017, All rights reserved.

Contact us

Get In Touch