Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by SpaceHorse

When we create an Entity, the box2d object creates automatically. So, how can i then cange the size of box2d object? I only found how to destroy it and create again. but it doesn't seem like a right way. Do any of you know how to change box2d (Box object) size after it created?

1 decade ago by dominic

I've googled a bit and it seems that there's really no way to resize a body in box2d, other than deleting and recreating it.

If you just want to create the box2d body with a different size (or shape) when the entity is created, you can overwrite the createBody() method in your entity classes. Have a look at what it does in lib/plugins/box2d/entity.js.

1 decade ago by SpaceHorse

yea yea i know. i actually added alot of logic already when i added new entities.
with box2d there are some tuff things. like in your 'physics' example everything is really simple but when i started to add more entities it started to be not that easy.
for example i still don't know how to make an entitiy which i can jump thru. (there is an article here but it's not for box2d).
i want to really figure out how to use both collision models together. like your collision model and box2d. it seems easy but i have to try more)
Page 1 of 1
« first « previous next › last »