frame

Howdy, Stranger!

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

Sign In Register

Any help with my game?!

edited February 2014 in General
Let me start off by saying that this is not a serious game. Only trying to learn the anatomy of flowlab. I have a problem, and I have absolutely no idea how to fix it. If you manage to read all of this, I will be damned and impressed.

The concept of my game:
4 symbols are consistently spawning in 1-second increments. Press the button at the bottom that corresponds with the spawned symbol. It will eliminate that symbol. Eliminate all 4 symbols.
If you do not click the correct button, a message will pop up and will delay your time. Try to eliminate all symbols as fast as possible.

My problem:
Please do try to comprehend the following, as it will be very essential for you to provide me a solution. Please bear with me. And so:

-I want the game to pause if you do not react in time for clicking the corresponding symbol. Correct? Due to that, I need a toggle switch for the BUTTON. And that, is what is screwing me up. (for the toggle switch: Output 1=pause game, Output 2=destroy symbol)
-So you're asking yourself; how does the game know if you missed the symbol? Well my friends, I will tell you:
when any other symbol has spawned. They send messages to the button's toggle switch's "next" input. Smart idea? Heh heh, no.

-I have four symbols: red, blue, green, and yellow.
-For example: when red spawns, it toggles NEXT to OUTPUT 2. But what about when it despawns? How do I tell the game it despawns so I can switch the "NEXT", or OUTPUT 1? (so the button knows if the symbol is not there and needs to pause the game if you missed the symbol)

-...sadly enough, when the next symbol spawns (which is completely randomized fyi), that's how I tell the toggle switch to toggle. Seeing the problem here? Every time a symbol spawned, each button's (4 in all btw) toggle switch is constantly being toggled!!! Which therefore means that my game is broken. You can cheat because OUTPUT 2 is constantly being activated and deactivated, regardless if the symbol has spawned.

A work around? I think my issue is that I need some way to tell each button that their symbol has despawned. I probably over complicated this...I apologize if I have. It's simple, really. If you can think of anything, let me know. I will provide the link if asked.

Comments

  • Hey Muphins, how about this?:

    1) Create 4 button objects: red, green, blue, & yellow
    2) Create one "Symbol" object type
    3) Open up your Symbol object type and add four animations, each with one frame:
    "red", "green", "blue", and "yellow"

    Now, when you spawn a symbol, have it choose a random number between 1 and 4.
    If it chooses 1, play the "red" animation in a loop.
    If it chooses 2, play the "green" animation in a loop.
    If it chooses 3, play the "blue" animation in a loop.
    If it chooses 4, play the "yellow" animation in a loop.

    When you click one of your button objects, have it send a message "click" to the symbol, along with a number.

    The red button should send the number 1, green should send the number 2, etc.

    In the Symbol, if the number sent matches the number that was picked as an animation, then they match and you get a point (or whatever). If it fails, then you hit the wrong button, so you can take away points or whatever you want to do.

    Make sense?





  • edited February 2014
    I get the gist of it but don't know to implement it properly. As for the symbol spawner, I'm guessing it goes like:

    Always - Random (min 1 max 4) - filter (equal to 1) - pass ; animate red (loop)
    - filter (equal to 2) - pass ; animate green (loop)
    - etc.?

    The reason I ask is because I don't know how the symbol will detect the button's sent number and message? Can it detect the "randomize" numbers (min and max numbers)?

    Also, by "have it send a message to "click" to the symbol, along with a number", are you implying that the message's message is a number? Or actually add a number logic to my button, along with a message?
    (And through what specific behavior/input is the message "click" being connected to?)

    Basically, I'm having trouble visualizing and understanding how a number can be used as a basis for the button's symbol detection? Merp lol.

    I may need an example for this, but if it's too time consuming, no worries :)

  • > I get the gist of it but don't know to implement it properly. As for the symbol spawner, > I'm guessing it goes like:
    >
    > Always - Random (min 1 max 4) - filter (equal to 1) - pass ; animate red (loop)
    > - filter (equal to 2) - pass ; animate green (loop)
    > - etc.?

    Yep, exactly.

    > The reason I ask is because I don't know how the symbol will detect the button's sent > number and message? Can it detect the "randomize" numbers (min and max numbers)?

    Add a "Number" behavior, name it "color" or something, and store the randomized value in there. That way you have something to check against.

    > Also, by "have it send a message to "click" to the symbol, along with a number", are
    > you implying that the message's message is a number? Or actually add a number logic
    > to my button, along with a message?
    > (And through what specific behavior/input is the message "click" being connected to?)

    When you send a message, whatever value you send into the message behavior comes out the other end in the mailbox behavior. For example, if you send a message like this from your green button object:

    [Mouse Click] -> [Number (2)] -> [Send Message ("click")]

    Then when the mailbox in another object sees that "click" message, the number (2) that was used to trigger the send will be sent from the output of the mailbox trigger. Does that make sense?

    > Basically, I'm having trouble visualizing and understanding how a number can be used
    > as a basis for the button's symbol detection? Merp lol.

    When you get the click message, compare the number that was sent with the message to the one that was picked by the randomizer.

    > I may need an example for this, but if it's too time consuming, no worries :)

    I know this is confusing because you aren't the first person to have trouble with this exact scenario. I will try to put together an example sometime soon.
  • I will be needing an example for this actually...the animations refuse to animate, and I'm unsure as to where to put these messages...
Sign In or Register to comment.

flowlab.io

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

Contact us

Get In Touch