Search the Community
Showing results for tags 'sprite body bug?'.
-
Hello, comunity and Richard. When I create my player, I use the follows code: creature = game.add.sprite(-500, -500, 'hero', 2, group);game.physics.enable(creature, Phaser.Physics.ARCADE);creature.body.gravity.y = 500;creature.scale.set(xFactor, yFactor);creature.body.offset.x = creature.body.width - creature.body.width * 0.8;creature.body.width = creature.body.width * 0.8;After creature.scale.set() phaser immedeately change creature.width, but doesn't change creature.body.width. Then I change my creature.body.width to needed value, but after first update() run phaser set creature.body.width to updated creature.width. How I understood, it's because phaser update physics after each update() iteration. Is it normal behavior?
-
Hello, comunity and Richard. When I create my player, I use the follows code: creature = game.add.sprite(-500, -500, 'hero', 2, group); game.physics.enable(creature, Phaser.Physics.ARCADE); creature.body.gravity.y = 500; creature.scale.set(xFactor, yFactor); creature.body.offset.x = creature.body.width - creature.body.width * 0.8; creature.body.width = creature.body.width * 0.8; After creature.scale.set() phaser immedeately change creature.width, but doesn't change creature.body.width. Then I change my creature.body.width to needed value, but after first update() run phaser set creature.body.width to updated creature.width. How I understood, it's because phaser update physics after each update() iteration. Is it normal behavior?
- 3 replies
-
- sprite body bug?
- sprite
-
(and 3 more)
Tagged with: