calminthenight's Recent Forum Activity

  • Create a variable called IDGenerator. Whenever uou have an event that assigns a value to an instances treasureID variable use the IDGenerator value and then add 1 to IDGenerator. Store the IDGenerator value in local storage or use whatever method suits your game and then load that value back in at the start of each game session.

  • Search the forum and the tutorials for angry birds. There are plenty of links to clones.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can right click anywhere on the dev console and press 'Save As'.

  • When you check this option your audio should continue when you navigate out of the app. Are you saying that your audio still pauses when you navigate out from the app?

  • If you already have a project that uses sound then the audio object is in your project window. You can search at the top of the project window for it.

    If you have project that does not have it added, in the insert new object window you can search inside there too.

  • Add the audio object to your project. Select the audio object in the project window. Check the "Play in Background" option in the audio object's properties window.

  • Not possible.

  • Would it not be better to just modify the string that already determines the array index?

    For example your current string is 4231 and if you want to invert positions 2 and 3 you would change the string to 4321?

  • Thanks ROJO that's much neater.

  • In the screenshot the function was called normally so it can’t take multiple frames to complete. It would run till it’s done.

    Of course, that makes sense and means it should work. Thanks, my tired brain never even considered that it is actually restricted to running within that tick.

    The array could be considered sorted if the sub event isn’t run once in an entire loop. You could use a variable for that: set it to 0 before the loop, set it to 1 in that sub event, then check if the var is still 0 after the loop. But then all the previous recursions would need to finish all their loops of doing nothing before it was truly done.

    I tried this method and it consistently failed. Likely due to how recursive functions stack.

    Another idea is to pass a depth parameter to the function When you first call the function use 0. Then each recursed call would be depth+1. Finally add another event to the function to check if depth=0, and if it is the whole function is done.

    I had also tried this exact method but it failed with inconsistent results, often stopping the function before the sorting was complete. Couldn't work out why.

    Personally I’d write the sort in a non recursive way. Like sorting one column at a time. If for no other reason but to be more efficient. Your function will sort but it will be looping over the array a lot.

    I agree, it's not the most efficient but I can't think of a way to sort all the non zero values in a single column to the bottom without recursion.

calminthenight's avatar

calminthenight

Member since 28 Jan, 2018

Twitter
calminthenight has 6 followers

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies