Unless you are writing a lot of data (megabytes) to local storage, saving should take only a fraction of a second. So the chance that player will close the game at the exact same moment is very small.
What's the point of posting the same thing over and over? Did you even read my replies?
That spike in collision checks is not normal. Check in the Debug Mode - make sure that only one instance of enemy is spawned (not thousands for example).
Check out this demo:
dropbox.com/s/30gfm0rygew4bb0/MinimapRound.c3p
It only works with rectangular objects. If you want to display any objects (with textures, different shapes, angles), you will have to paste them, it's a bit trickier, here is an example:
dropbox.com/s/csn2fynev57mu9l/Minimap_DrawingCanvas.c3p
You can check if Enemy.count=0
If you are adding new enemies, consider using a family for them.
You can do this with scripting:
var obj = runtime.objects.Sprite.getFirstPickedInstance(); var result=0; for (var key in obj.instVars) { result +=obj.instVars[key]; } console.log("Result=" + result);
But it may be more convenient in this case to use a dictionary or an array instead of a bunch of instance variables. Add the dictionary and the object to a container, and each instance of the object will have its own copy of the dictionary.
Here you go:
dropbox.com/s/az95zmd2tac1wzv/ZombiePoker.c3p
Тыкай зомби копьем :)
Develop games in your browser. Powerful, performant & highly capable.
Try searching stackoverflow, there may be a different method to call .click() on Safari.
Do you mean when monster is overlapping an image point in another sprite, it dies? Like, for example, when player hits a monster with a sword?
You need to use System Pick Overlapping Point event.
Pick Monster Overlapping Point X=Player.ImagePointX("Sword"), Y=Player.ImagePointY("Sword")
You can ignore the turrets shooting system and make your own with Timer behavior:
Note, that the last condition is inverted, it means "when turret does NOT have a target"
There is an addon which can do this:
construct.net/en/forum/extending-construct-2/addons-29/behavior-pin-123766/page-5
But it would probably be better to do with relative coordinates, as oosyrag suggested.
I forgot one more option:
4. Import images for all levels into the project (in Files folder), and on start of layout load the required image into the Character sprite.
This is not a good method, but it may work for some games.
Member since 26 May, 2016