dop2000's Forum Posts

  • That's what I keep telling you - you need to wait until the data is read from local storage. This doesn't happen immediately, like with Webstorage. You can't compare Level variable in "On start of layout", because this value has not been retrieved yet.

    What you can do to fix this is move this Level check into a function. And call this function from both "On item Level exists" and "On item Level is missing" events.

    This is another reason why it's better to save all values at once in a dictionary. This way they will all be loaded at once and you won't need a hundred of different "On item exists" events.

  • savvito123 "Item get" and "On item get" steps are not required, this just adds many unnecessary events. From the documentation:

  • Yes it's true there is no global variables on this Event Sheet.

    This is not what I said! It doesn't matter in which event sheet your global variables are defined.

    I meant you need to run the game in Debug Mode and check your global variables - Levels, Experience etc. You should be able to see if they contain default values, or if the values loaded from Local Storage.

    .

    I think the values are loaded correctly, but you are checking them too soon. It takes some time to load data from Local Storage.

    If you can't figure out the issue, please post your project file.

  • When do you get that error? When you are adding LiteTween behavior to a sprite? Can you try in a blank new project? Create a sprite and try to add LiteTween behavior to it.

    If this doesn't work, try a different browser.

  • Run the project in Debug Mode and check the variables. I'm guessing the values are loaded from Local Storage just fine, and the problem is with other events. (You should wait for the values to load, before trying to access them)

    Also, check out this demo showing an easier way to save many values in Local Storage:

    howtoconstructdemos.com/easily-save-multiple-values-in-local-storage

  • Click "Edit" on the first comment.

  • You can edit your topic and change the title.

  • You do not have permission to view this post

  • "This upload does not exist"

    You are probably not picking the correct enemy instance, this is a very common mistake.

    There are many ways you can pick an instance, for example "Enemy pick nearest to Player", or "Player on collision with Enemy" etc.

  • You call it "camera" which is confusing. The UI doesn't follow the player, it should stay in the same position on the screen, that's why it needs to be on a separate layer with parallax set to (0,0)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to save the initial values in a pair of variables. Then you can do this:

    Set value2 to startValue2*(value1/startValue1)

  • Well, if you absolutely need to use 4000px image for the background, you can of course do it. I think the maximum supported size is 4096x4096. If your image doesn't exceed it, you don't need to cut it into smaller pieces, there will be no notable difference in performance or memory usage.

    Just be aware that each of these 4000x4000 images will take about 100Mb of memory.

  • Would it be better to cut it into pieces and place it out like a puzzle? Or just use it as a whole? Can i cut it into 1000 pix each and place them next to each others??

    No, all these are equally bad ideas. What I meant is - try using a repeating background when possible. Instead of 4000px image of the sky with clouds and birds, use 200px TiledBackground with the sky, and small separate sprites for clouds and birds.

    Check out this Ashley's article:

    construct.net/en/blogs/construct-official-blog-1/remember-not-waste-memory-796

  • 1. Layout size itself doesn't matter, you can have 1000000px layout. The objects that you put on the layout are important.

    2. It's much better to have one 500x500 px background sprite repeated a hundred times, than one 2000x2000 px sprite. That's why it's recommended to use TiledBackground for backgrounds.

    3. It depends on too many factors. You should regularly check performance as you develop your game, and if you notice a big performance drop, fix it.