Search the Community
Showing results for tags 'method'.
-
Hello, i have been started working with BJS short time ago. I couldn't understand the using rebuild method. I have one issue i think i can solve that with rebuild method but i coluldn't understand how to use it. Can somebody explain it pls?
-
hi there im wondering what happens to a child element when its parent suffered .kill() or .destroy() method? does it also get erased from earth? thanks!
-
I am learning to use this engine, but compared to some methods I've seen online, for example Phaser.js. not managed to create a method that can make my player shoot. This is my class and my method. game.createClass('Shoot', { init: function(x, y){ this.disparo = new game.Sprite('shoot.png'); this.bodyDisparo = new game.Body({ position:{ x: x + this.disparo.width, y:y } }); var circulo = new game.Rectangle(this.disparo.width, this.disparo.height); this.bodyDisparo.addShape(circulo); game.scene.objectContainer.addChild(this.disparo); game.scene.world.addBody(this.bodyDisparo); game.scene.addObject(this); }, shot: function(){ this.bodyDisparo.velocity.x = 260; }, update: function() { this.disparo.position.x = this.bodyDisparo.position.x; this.disparo.position.y = this.bodyDisparo.position.y; } }); Not if well implemented this code I wrote. I'm learning to program games in html5.
-
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.