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

10 years ago by Sledge

So, I am trying to incorporate some realistic physics into my game. I am finding that when I do this it doesn't feel very 'gamey'. What I would like to do is use the default this.accel., this.vel. methods to move most things around, while utilizing box 2d to handle specific collisions between things like rockets, giblets, crates etc...

Has anyone here tried anything like this? Can anyone say if this is a viable approach? It's not clear to me from the documentation if you can mix and match like this. I am trying to make it work by fooling around with the various parameters. So far I have not been successful in finding a set of game parameters which balance the Box2D this.body.ApplyForce() type methods with the default game this.accel., this.vel. methods to manipulate the player entity in a sensible way.

I hope this is a coherent description of what I am trying to do, any comments would be appreciated. Thanks!

10 years ago by mimik

I guess that your entity in the Box2D world is an box2D entity already.
But you can create a normal entity as well.

depends on what your using

EntityPlayer = ig.Box2DEntity.extend({

or regular
EntityPlayer = ig.Entity.extend({

But if you want to control the Box2 Entity as a regular Entity?
Then I think you need to create a function yourself for that in the box2d entity.

You can also use this.body.ApplyImpulse();
To create movement.

10 years ago by Xatruch

you can set velocities on box2d

this.body.m_linearVelocity.x = 10;

10 years ago by Sledge

Thank you for the helpful replies! @mimik I was going down this path and it wasn't giving very fun gameplay, which is why I am now trying to avoid it. @ Xatruch - this is what I was looking for!

I hope to have a demo ready soon. Thanks again
Page 1 of 1
« first « previous next › last »