mekonbekon's Recent Forum Activity

  • jhjconstruct, oosyrag, jobel, AllanR

    Here's a way to shuffle an array using only a single array and a local variable:

    https://www.dropbox.com/s/h8pmfmjgfkvu8 ... .capx?dl=0

    Run it in debug to check the array sorting.

    It works by picking a row from within the array width, pushing it to the back of the array, and then using the loopindex to reduce the number of rows to pick from, until all rows in the initial array have been picked and pushed to the back.

    I've just randomly shuffled, but if you wanted to apply a particular sorting criteria then you could modify event 3.

  • IGDev Also in your example it looks like you have a bug where clicking on the same sprite1 will generate additional lines - or is this intended? If you explain the required behaviour I can have a go at patching it up.

  • IGDev Hi there, the reason your lines widths are changing is because you haven't disabled/deleted event 8, which randomises the the width of any sprite in the "sprites" family; I put that event in to demonstrate how the totalwidth value updates when the widths change - you don't need it.

  • Romalex360 ah, fair point. I'll have a think about it and let you know if I come up with a different solution.

  • This might work (no guarantees though - haven't tested it!):

    Create a new layer called "loader" above all the other layers.

    Add a tiled background that covers the entire window and a sprite with a loading animation to the layer.

    Add a global called lastObjectCount.

    We can now use the system expression"objectcount" to check how many objects have been loaded in:

    Every X seconds if lastObjectCount < objectcount, set lastObjectCount to objectcount

    Else set layer "loader" invisible (and start the level, activate the player character etc)

    Adjust the X seconds to find a value that doesn't trigger incorrectly.

    Like I said, just guessing so could be a load of old rubbish - apologies in advance if that's the case!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's an example using a function. In the example I call the function at the start and on any mouse click (the mouse click also randomises the widths of the sprites to simulate the sprite widths changing during runtime) but you can call it whenever you need to in your project:

    https://www.dropbox.com/s/zel61966va8ym ... .capx?dl=0

  • - perfect! Thank you

  • This demo shows how to display total number of points, points per level, hiscore for points per level, and save to local storage - hopefully that covers everything <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    https://www.dropbox.com/s/2fqk21sm87kma ... .capx?dl=0

  • MPPlantOfficial Good point, cheers. In fact Square would work better than sawtooth, should jump between 0 and 1.

  • Hello!

    Does anyone know if it's possible to set the flash behaviour to continuous rather than stipulating a time? I know I could just give it a crazy big number or create a function using timers/every X seconds, but it would be handy if I could just set it to run indefinitely (setting it to -1 seconds, for example).

  • Hi maxwell88 one way might be:

    Create a global variable e.g. totalWidth

    Put all your sprites in a family e.g. allSprites

    Trigger once:

    System|For each allSprites: System|Add allSprites width to globalwidth

    Set text on text object to globalwidth

  • There's a system condition "If number is NaN" that you can use to check.

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies