lionz's Forum Posts

  • Returning to your original question, in the second post you are clearing storage immediately after saving to it, that isn't going to do anything. On the first post it depends when you are saving and loading. We can't see the layouts or structure, probably it works if you perform save and load at the right times, maybe you are saving too early, hard to tell from just the screenshots.

  • Not sure on overwriting the first line, the events look fine to me except the bit where you set text on getting the local storage item isn't in a loop and it should be, like the other part where you set text using loopindex.

    Is the array always correct? Check the array in debug view when you set the text to see if it matches with the text. If they don't match and it's just a text display issue then it's not the worst bug ever but I couldn't work out why it would skip the first line of the array.

    As the original issue was to do with loading from the array, then make sure that set text is in a loop as mentioned and make sure the array is correct and as you expect on loading storage item.

  • You've not given any information though, please check out this post construct.net/en/forum/construct-3/how-do-i-8/best-help-tips-forum-139528

  • Do you mean overwriting the first line on the text object? The array is the important part so make sure that's correct. Share a screenshot of how the new events look. If you clear the text each time it should work.

  • I think the main problem is the bottom event is meant to be a sub event. It's ok to run that loop after you update the array but you have it running constantly on its own. Press S and add as a sub event so it runs after you updated the array and only once. Also I suggest setting the text of Name to "" to clear it before running the loop.

    It's confusing because I can't see where you've saved but if 'highscore' in local storage is just the name then you should run the loop again on the event where you get highscore and the array is loaded. The part where it runs on start of layout can be removed as this will not do anything it is using loopindex but not inside a loop plus the array hasn't loaded yet at that point.

  • There's actually a ton of confusing stuff going on here. From what I can see it looks like the array only contains a list of names not scores? You input a name and then push it to the array, where does the score come in? The save events are kind of important but you didn't share them, so what you are saving is a list of names? We can only guess.

  • Didn't quite get it, the 'go to layout' action didn't work for you? Are you trying to load a save game?

  • Music is loaded as you play it. For the sound effects you can disable the 'preload sounds' project property so they are not all loaded at the start of the game, then you can use the preload action to load the audio content you want. Later you can also unload it if for example you switch to that different environment and you no longer need that audio.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you are referring to sprite creation why have you blurred out the important events? When you create an instance yes you need to wait until next tick for it to be available.

  • It's always difficult picking with the same object however if you change it to 1 when touching the green it does mean it's different. A second variable might also be useful to differentiate it from the others to work out what's happening.

    One way is to use system pick nth instance 0 and 1 in the overlap of red and red. You might be able to compare 0th instance where variable changed and then pick 1th instance and change that variable.

    Another way that is to put red sprite in a family. Then when you change the red sprite that is touching green to 1. You can say if family where var=1 (the red sprite) is overlapping red, then change red. This successfully picks the other red sprite as the first one was picked as family.

    They are the two ways I know of to do this.

  • Do you mean all red sprites or only red sprites that are touching the one that was touched by the green sprite?

  • Yes it's called an 'array file' on the side bar and looks like an excel sheet with rows and columns. You can fill it out there and load this file into the array on start of layout using AJAX, request file then load into array ajax.lastdata

  • It's about conditions and picking of instances. Depends how you structured your events. If for example you add a condition that one overlapping the player dies then only this one will be destroyed.

  • Well you are almost there because you are using random for the x, it's create object at y = random(100,300)

  • I'm not sure if by polygons on animation you meant collision but check the collision box and make it a box shape. Note this can change per frame of an animation so apply to all frames/animations.