oosyrag's Forum Posts

  • This is why sprite fonts and web fonts are a thing.

  • This may not be possible with C2 as it currently stands.

    You can append a caret to the text object. The only way I can think of to get the position of the last character is if you placed every character in its own instance of a text object, which is possible, but probably not very elegant.

  • Are all the sprites one object or separate? If it is one object you can use a loop and a counter.

    First set CounterVariable to 0.

    Repeat Sprite.Count times - Add Sprite(loopindex).Width to CounterVariable.

    Make sure the loop runs by trigger and not every tick.

    If they are separate objects you should be able to do the same thing with family.

  • Unlikely to be the cause of lag.

  • Add the following conditions to your event...

    Is touching button 1

    Is touching button 2

    Run once while true

  • The expression Browser.ExecJS("Date.now()") will get you Unix time in milliseconds. You can keep track of this by regularly saving it to local storage, and upon starting up your app you can compare the difference between the saved time and the current time to see how much time he passed.

  • Yes. Changing the positions of a lot of objects every tick probably utilizes significantly more resources than just changing the position of the viewport (or a single invisible helper sprite with the "scroll to" behaviour).

  • Ok if it's a sorted one dimension array that makes things a lot simpler.

    For each x,

    If array.curvalue = array.at(curx+1)

    Or

    If array.curvalue = array.at(curx-1)

    (Do nothing)

    Else

    Delete array index array.curx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How large is your number/value range, and how large is your array? The straight forward method will be pretty resource intensive if you have a lot of numbers and/or a large array to check.

    You might want to approach this from a different angle, depending on your situation. How is your array being generated in the first place?

  • There are a million different ways to do it in photoshop. Try asking on a photoshop/graphic design forum.

  • You are not using localstorage properly.

    After a "Get Item" action, the LocalStorage plugin does not have a value until "On Item Get" triggers.

    https://www.scirra.com/manual/188/local-storage

    [quote:2x421knt]Local Storage is asynchronous. This means reading and writing data does not complete immediately. The actions only start the process of reading or writing a value, and the game continues to run in the interim. This ensures that slow or busy storage systems do not impact the performance of the game. When the read or write is complete, a trigger fires (On item get or On item set) which indicates either the value is available to read (with the ItemValue expression) or that the value was successfully written.

    Basically, think of LocalStorage as a database server (that happens to be on the same computer as your program). You send it a request, and don't how long it will take to reply. Use the "On Item Get" condition trigger to "catch" the reply when it comes.

  • Made a quick example for my own reference, sharing in case it can be of use for others.

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

    ref: https://en.wikipedia.org/wiki/Smoothstep

  • Thanks, that'll do it. I missed that post completely. Too bad it isn't available yet. I guess multiplayer isn't really available for free version either anyway.

    Going to mention I would never have found it on my own without reading that blog article. I hope it gets added to the menu dropdown.

  • Update regarding the bounce, it isn't a bug or a rounding error, realized the ball collision box is just drawn a bit wonky.

    Although still, C2 and C3 versions behave differently for me - I don't know if this is supposed to happen.

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

    https://www.dropbox.com/s/qdsai6603tijx ... 3.c3p?dl=0