I have this code:
function exitGameScene() {
/*
var platforms = entityManager.getEntityArrayByType("platform")
for (var i=0, platform; platform=platforms[i++];) {
platform.removeEntity()
}
var keys = entityManager.getEntityArrayByType("key")
for (var i=0, key; key=keys[i++];) {
key.removeEntity()
}
*/
entityManager.removeAllPooledEntities()
As you can guess, platforms and keys are the pooled entities that I have.
The commented section does what I need, but the call to removeAllPooledEntities() does not.
I can see removeAllPooledEntities() doing this:
qml: EntityManager: removeAllPooledEntities()
qml: EntityBase: onDestruction(), emit entityDestroyed signal for entityId platform_9
qml: EntityManager: just removed static entity defined in QML file with id platform_9 and type platform from active entities
yet when I do it this way, the image of the platform remains in the level next time the level is activated.
(The platform itself is not present next time: it does not affect the level in anyway, it is just drawn – which is why I am doing this removal in the first place).
This is not the case when I do the individual removeEntity() calls.
What’s going on there?
-
This topic was modified 8 years, 5 months ago by
GreenAsJade.
-
This topic was modified 8 years, 5 months ago by
GreenAsJade.
-
This topic was modified 8 years, 5 months ago by
GreenAsJade.