Jump to content

Update Method Inside Scenes Question


Recommended Posts



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?


PS: Sorry for my english. :)

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...