Jump to content

[question]changing properties of the physics body type in a group


shotmachine
 Share

Recommended Posts

hey there,
after doing the first tutorial in the phaser site, i wanted to add a group that could easily create enemy sprites.

baddies  = game.add.group();baddies.enableBody = true;

i want the enemy to all have the same vallues for things like gravity.
but i can't figure out how to do it/ what i have to change.
i tried things like:
 

baddies.body.gravity.y = 500;baddies.physicsBodyType.arcade.gravity.y = 500;

those obviously don't work, but maybe they help you understand what im trying to accomplish.
i couldn't find how to do it anywhere.
i'm still a bit new in the javascript world so i'm sorry if i made a really dumb mistake ^^.

thanks for reading :).
 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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