Hi,
I’m just starting and I would like to build a powerboat, the user watches from top and steers around the screen. So the whole screen is the water.
I’m using
[lua]physics.setGravity( 0, 0 )[/lua]
The powerboat should move by turning the engine at the back of the boat. How do I construct this?
Should I use
[lua]applyLinearImpulse[/lua]
or use a joint to connect an engine that uses
[lua]myJoint.isMotorEnabled[/lua]
? But how would it drive on water?
A hint for the right direction would be great,
best
Joerg [import]uid: 55806 topic_id: 9416 reply_id: 309416[/import]
I just discovered this example with box2d for flash:
http://www.emanueleferonato.com/2009/04/06/two-ways-to-make-box2d-cars/
Maybe I should use just one wheel as the engine for my powerboat.
But how do I translate
leftWheel.GetXForm().R.col2.Copy()
into Lua?
//Driving
var ldirection = leftWheel.GetXForm().R.col2.Copy();
ldirection.Multiply(engineSpeed);
var rdirection = rightWheel.GetXForm().R.col2.Copy()
rdirection.Multiply(engineSpeed);
leftWheel.ApplyForce(ldirection, leftWheel.GetPosition());
rightWheel.ApplyForce(rdirection, rightWheel.GetPosition
Best,
Joerg [import]uid: 55806 topic_id: 9416 reply_id: 34452[/import]