Jump to content

Sprite.body - behavior


Chendler
 Share

Recommended Posts

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?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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