lionz's Forum Posts

  • Technically they are at the correct positions but you're scaling individual layers. If for example the police unit is on a scaled layer and the ground is not then it will look offset. Usually I use set layout scale for zooming, which scales everything together and avoids any issues like this.

  • Can't get to that file but I'm assuming it's because of the top to bottom structure of events in C2, where you've probably said if 0 set to 1, if 1 set to 2 so it makes the first event and second event true in order. You can add a small wait 0.1 secs before you set the variable if you want, this should stop that from happening. My guess could be completely wrong but I am assuming this is what you've done.

  • Usually in appdata folder.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would use a function for something like this because of the trigger event. I've left a wait in so you can actually see what it's picking.

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

  • The way that logic is set up, it picks the 3 random sprites first before doing anything else, so it can pick the same one more than once.

  • Oh right, yeah just use the tilemap on its own if you're going to build it like that. No need for an additional sprite for collision.

  • Not entirely sure what you're asking here in terms of an invisible solid sprite for the collision but a tilemap is used mainly for top-down games to map out large areas with optimised collision. For a 2D platformer you wouldn't use a tilemap, likely just sprites with box collision for platforms.

  • That is what you're after? I didn't look too deep into the logic of the game.

    https://www.dropbox.com/s/1sj8rr6h3n0kn ... r.jpg?dl=0

  • No idea about that but you don't need to use that save state now that you've explained what you're trying to save. To check whether time attack mode is available you just need local storage and a key. To toggle whether it is available use a global variable instead of an instance variable.

  • The problem is that you said you wanted a way of saving instance variables and I recommended that link. What you should be doing is saving that unlock information as a global variable, local storage is what you should be using for this. If it's not working properly with other global variables then it's a logic error, possibly you are loading the key items to global variables then resetting their values afterwards.

  • You can safeguard it by not resetting global variables many times. If you want to store variables FOREVER as a mechanism for when something is unlocked by a user then I don't see how resetting them can be good practice. In this case I would reset individual global variables that need to be reset, if they have to be. You could probably reset global variables then load all the keys from local storage but I've not tried this around a reset.

  • You need to use a global variable and local storage for that.

  • You save the state of the game. You then exit, re-enter and load the save state, it loads it at the time when you saved it with the same variables and objects. It is like taking a screenshot of the game at the point where you saved it.

  • What did you try?

  • If you're referring to a lot of objects each with their own unique instance variables then it is better to go for the save state method, which simply saves the state of the game at that point and the values of all objects.

    https://www.scirra.com/tutorials/526/ho ... -savegames