Pick a random enemy and send it to the target. When it arrives, set hasMoved to True, then pick another random one that hasn't moved yet and send it etc.
oneAtATime.capx (r139)
You can use the array download action to save the array to a file and then add it as a project file. See this:
https://www.scirra.com/tutorials/328/using-project-files-in-construct-2
Hmm make sure there is actually a path from bad_dude to dude and that neither of them have solid behavior if you're using solids as obstacles.
Develop games in your browser. Powerful, performant & highly capable.
Have you got another event:
bad_dude: on path found -> bad_dude: move along path
And make sure you're not checking for paths every tick when in line of sight. You could add a "system:every x seconds" condition.
You don't want "" around the variable name when you save it. You're saving the string "xed" instead of the value of the variable.
The 'ProgramTip: NOT Is on-screen' event won't run if there is no 'ProgramTip'. You should check if ProgramTip.Count == 0.
You can change the loading icon in Files/Icons/loading-logo.png.
<img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/loading-logo.PNG" border="0" />
First you're using a for each loop so only one sprite will be picked on each iteration. There's no point picking the sprite with the smallest distance from a group of one. As well as that 'on pathfinding path found' triggers once for each sprite so even the loop is unnecessary.
You'd want to calculate all the paths first and then pick the sprite with the smallest distance once each sprite has calculated it's path.
moveWhenAllPathsFound.capx (r139)
It's probably the disabled 'else' in event 71. Without the else then when you press 's' it drops the civilian and then immediately catches him again.
Any idea why it starts to lag after a while?
You're creating a lot of HUDRocket sprites. See in event 22 it's constantly creating new sprites when RocketsAvailable > 0. It's always good to always display objectcount in your debug text. You'll see when you collect the first rocket the objectcount starts rising rapidly.
The first sounds like you might have some 'on destroyed: spawn object' type events. When you change/restart the layout all the objects are destroyed and that spawns new objects on the next layout.
What about collision polygons? Are the frames the same size?
Member since 17 Apr, 2012