frame

Howdy, Stranger!

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

Sign In Register

Variable names

Switches and numbers will have a new property: "variable name".

All numbers with the same variable name will always have the same value. The same with switches, they will have the same state (on/off). Very useful because now I use the save behavior and set it to 0 when the game starts.

Comments

  • Oh and forgot to say: Labels will be shown in the top-right of the behavior block (like always), and variable names in the bottom.

    So @grazer, what do you think?
    Flowlab!!!
  • This is an interesting concept. I've considered doing something similar, by allowing values to be "shared", that would work like this:

    If you set the Number with the label Health to "shared", then any Number with the label Health would always have the same value.

    One downside with this is that it would be really easy to create hard-to-find bugs, since there isn't a good way to tell what is updating your value. It may be worth the trade-off though, since it would reduce the need for sending as many messages back and forth. I'm not sure.
  • edited January 31
    So like a temporary save? Interesting

    You could probably make a custom block that does this using messages that sets a number though.... but this would be faster tenfold
  • Yeah, like you said - you can do this using messages already. Having it built in might be a handy shortcut though.
  • This could be handy for a lot of things, now that I think of it, such as....

    Now that I think about it the things I would bring up would be only handy for me and Latif because we both have arcade games...
  • For now you can use save behaviors and set them to 0 when the game starts. But I can guess it's not very efficient
    Flowlab!!!
  • Saves count set them otherwise
  • @grazer Is "shared" an input or boolean property?

    If it's an input, I don't like your idea. Often I want to read a value when an object is spawned, and I want to do that easily like with the save behavior.

    If it's a boolean property, perfect.
    Flowlab!!!
Sign In or Register to comment.

flowlab.io

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

Contact us

Get In Touch