- Joined
- Jan 26, 2014
- Messages
- 1,281
- Reaction score
- 106
- First Language
- Irish
- Primarily Uses
- N/A
So I went on making a simple image to be displayed when you invoke an action:
But it says undefined is not a function on the this.addChild line. Is there a problem adding sprite images in BattleManager?
(function(){ BattleManager.invokeAction = function(subject, target) { this._logWindow.push('pushBaseLine'); if (Math.random() < this._action.itemCnt(target)) { this.invokeCounterAttack(subject, target); } else if (Math.random() < this._action.itemMrf(target)) { this.invokeMagicReflection(subject, target); } else { this.invokeNormalAction(subject, target); } subject.setLastTarget(target); this._logWindow.push('popBaseLine'); this.refreshStatus(); this.spAttack(); }; BattleManager.spAttack = function() { this.hiOugi = new Sprite(); this.updateSpAttack(); }; BattleManager.updateSpAttack = function(){ this.hiOugi.bitmap = ImageManager.loadPicture(this._subject.name); this.addChild(this._specialSkillAnimation); };})();
Last edited by a moderator:

