I have a motorbike looking shape that works fine until I hit a ramp.
The ramp is a curve like a quarter circle that points up so the
motorbike should point up the screen 90 deg from ground by the time it leaves this ramp. The ramp was crated with PhysicsEDitor.
The problem is I cant get the object to travel up the ramp and jump.
I have tried applyForce to death and I tried increasing motorspeed.
The object just hits the ramp and moves up a small way with the wheels spinning.
If I can get the object to travel along the curve surface then I could use applyforce when at the end of the ramp.Th object just wont overcome gravity. Box2D with Flash doesnt have this issue.
[lua] self.backwheel = display.newImage(“backwheel.png”)
physics.addBody( self.backwheel, {friction=1.0, bounce=0, density=0.1, radius=16});
self.backwheel.myName=“backwheel”
self.backwheel.x=x-10;
self.backwheel.y=y;
self.frontwheel = display.newImage(“frontwheel.png”)
physics.addBody( self.frontwheel, {friction=1.0, bounce=0, density=.1, radius=16});
self.frontwheel.myName=“frontwheel”
self.frontwheel.x=x+50;
self.frontwheel.y=y;
self.body = display.newImage(“body3.png”)
physics.addBody( self.body, {friction=1.0, bounce=0, density=.1});
self.body.myName=“body”
self.body.x=x+20;
self.body.y=y-20;
self.rear_weld = display.newImage(“weld.png”)
self.front_weld = display.newImage(“weld2.png”)
self.rear_weld.x=self.body.x -20; self.rear_weld.y=self.body.y +10;
self.front_weld.x=self.body.x +20; self.front_weld.y=self.body.y +10;
physics.addBody( self.rear_weld, {friction=1.0, bounce=0, density=.5});
physics.addBody( self.front_weld, {friction=1.0, bounce=0, density=.5});
self.rear_weld_joint = physics.newJoint(“weld”, self.rear_weld, self.body, self.rear_weld.x, self.rear_weld.y)
self.front_weld_joint = physics.newJoint(“weld”, self.body, self.front_weld, self.front_weld.x, self.front_weld.y)
self.myjoint = physics.newJoint(“pivot”,self.rear_weld, self.backwheel, self.backwheel.x,self.backwheel.y )
self.myjoint2 = physics.newJoint(“pivot”,self.front_weld, self.frontwheel, self.frontwheel.x,self.frontwheel.y )
self.wheel_distance_joint = physics.newJoint(“distance”,self.backwheel, self.frontwheel, self.backwheel.x, self.backwheel.y, self.frontwheel.x,self.frontwheel.y)
…
self.frontwheel:applyForce(2000,1000,self.frontwheel.x,self.frontwheel.y)
[/lua] [import]uid: 138547 topic_id: 26127 reply_id: 326127[/import]