hamdirizal Posted February 6, 2015 Share Posted February 6, 2015 Hi, I create a "Cat" class with its own "update" method. And a "Main" scene, which has its own "update" too. Here is the code:game.module( 'game.main').body(function() {game.createClass('Cat', { init: function() { }, update:function() { console.log('a cat') }});game.createScene('Main', { init: function() { this.cat=new game.Cat(); this.addObject(this.cat); }, update:function() { console.log('a house') }});});Now, It seems, scene's update is overriding the cat's update method. My question is, how to make them both called? I have used flashPunk (AS3) before. In this case I would use something like; super.update() is there any similar way to do it in panda?Thanks.PS: Sorry for my english. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 6, 2015 Share Posted February 6, 2015 Hi @hamdirizal I'm pretty sure, all you need is this ...update: function() { this._super();} Quote Link to comment Share on other sites More sharing options...
hamdirizal Posted February 6, 2015 Author Share Posted February 6, 2015 Hi @hamdirizal I'm pretty sure, all you need is this ...update: function() { this._super();}Thank you @Ninjadoodle It works. I'm pretty sure I've tried this. I don't know why it doesn't work before. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.