How does "Flash" work?

This forum is currently in read-only mode.
From the Asset Store
_______ Huge collection of metal fixtures ________
  • When setting a sprite to Flash, the options are for "Frames" and "Frame interval." What exactly constitutes a "frame?" If I wanted to flash a sprite for 3000ms, what would I put?

    And wouldn't milliseconds make more sense, since everything else is done in milliseconds?

    Edit:

    Hmm, I think I've figured it out... if I want three seconds of flashing, I set it to 180 interval? Does that sound right? Confirmation, please

  • Does frame rate effect it?

    edit: yes it does

  • Does frame rate effect it?

    edit: yes it does

    Well, that's no good

    All the more reason to change it to milliseconds. I hereby officially request this change

  • It's framerate dependent. It shouldn't really be there or it should be fixed, because obviously framerate dependent stuff sucks. The parameter is currently interval in ticks between flashing, when it should be in milliseconds. You should probably invent your own flash code.

  • flashing based on frames is still useful though... in old-school games transparency was made this way and it stuck around even when not needed anymore.

    On respawn set invulnerable and flash every other frame, etc, and you could coordinate complex flashing patterns between different objects for visual trickery.

    I'd use both.

  • I know you could do this with the timeline object, I tried a bit but couldn't get it to work exactly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Could use the timer behavior, also.

  • Ugh, found a bug when trying to make my own flashing work:

    https://sourceforge.net/tracker/index.p ... id=1003219

    Anyway, I'm also having problems with an alternate method of flashing a sprite:

    http://willhostforfood.com/users/D/deadeye/flash.cap

    The blue sprite is meant to turn invisible every 150ms, and turn visible every 300ms. It does work... but very poorly. For some reason it's flickery and inconsistent . This is for my tutorial, so I'm looking for the most concise, simple, and non-hacky-workaroundish method possible for flashing a sprite. Having the "Flash" action work based on milliseconds would solve this perfectly.

    Could use the timer behavior, also.

    I did try that, and ran into another bug. I'll try to recreate it and post that a bit later on. As I said before though, I am looking for the most basic and concise method for the tutorials, and honestly using the timer behavior just seems like overkill. It's a workaround that simply wouldn't be necessary if the Flash action were updated.

  • The blue sprite is meant to turn invisible every 150ms, and turn visible every 300ms. It does work... but very poorly. For some reason it's flickery and inconsistent

    Did some tests with the .cap. If you let it run with unbounded fps, blue sprite becomes very consistent. My guess is with vsync on, the time in which something is displayed and the time when it's calculated is slightly different, so tiny measurements like this will be inconsistent. Construct is double buffered I think, triple buffering mitigates these things somewhat but not completely. This is why I prefer doing things frame-based when the timing's really tight (and it doesn't affect logic).

    I can't make heads or tails out of "else". Tried making it a subevent and it does flash... for like a single frame.

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