1 decade ago by wicht
Hi there,
If i overwrite the settings of an Entity with a new animSheet (to keep Entities somewhat dynamic and configure them through serverside JSON), i get an DOM Exception 14 (Namespace_Err).
I just traced it down and the problem seems to be the impact.merge method...
it goes down to:
animSheet.image.date.ownerDocument.doctype.prefix
Usecase:
I think the deep copy of the AnimationSheet object is the cause of this problem. Maybe i'm doing it all wrong, but the settings parameter of spawnEntity seemed the right place to dynamically change the animation sheet.
A clue anyone?
If i overwrite the settings of an Entity with a new animSheet (to keep Entities somewhat dynamic and configure them through serverside JSON), i get an DOM Exception 14 (Namespace_Err).
I just traced it down and the problem seems to be the impact.merge method...
it goes down to:
animSheet.image.date.ownerDocument.doctype.prefix
Usecase:
MyGame = ig.Game.extend({ ... spawnZombie: function() { this.nextZombieSpawn = this.getNextZombieSpawn(); var spawnPos = this.getSpawnPoint(); var settings = {animSheet: new ig.AnimationSheet('media/zombieDog.png', 32,32)}; this.spawnEntity(EntityZombie, spawnPos.x, spawnPos.y, settings); this.zombies++; }, ... });
I think the deep copy of the AnimationSheet object is the cause of this problem. Maybe i'm doing it all wrong, but the settings parameter of spawnEntity seemed the right place to dynamically change the animation sheet.
A clue anyone?