KimKong

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by KimKong

  1. The issue was that with newer versions, the world does not step itself. To fix, add the following function to Main update: function() { this.world.step(1/60); },
  2. Hello, The example project, https://github.com/CodeAndWeb/panda2-physics-tutorial, does not work when upgrading the panda engine. The bodies does not appear to be moving. The problem shows up when upgrading to version 2.7.0. Does anyone know how to fix this? Kind regards, k
  3. Hi, When a camera Is added to a moving container, it does not update its position unless the target moves out of the sensor field. To me this looks like a bug. Is it possible to work around it? game.module( 'game.main' ) .body(function() { game.addAsset('sprite.png'); game.createScene('Main', { init: function() { this.container = new game.Container(); this.container.addTo(this.stage); var bg = new game.TilingSprite('sprite.png', game.width * 2, game.height * 2); bg.alpha = 0.2; bg.addTo(this.container); this.circleContainer = new game.Container(); this.circleContainer.addTo(this.container); this.sprite = new game.Graphics(); this.sprite.drawCircle(10, 10, 10); this.sprite.anchorCenter(); this.sprite.center(this.stage); this.sprite.addTo(this.circleContainer); this.camera = new game.Camera(this.sprite); this.camera.addTo(this.circleContainer); }, update: function() { var speed = 200; this.circleContainer.y -= 10 * game.delta; if (game.keyboard.down('LEFT')) this.sprite.x -= speed * game.delta; if (game.keyboard.down('RIGHT')) this.sprite.x += speed * game.delta; if (game.keyboard.down('UP')) this.sprite.y -= speed * game.delta; if (game.keyboard.down('DOWN')) this.sprite.y += speed * game.delta; } }); });