Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Revolution joint

Author
Message
Andycb93
13
Years of Service
User Offline
Joined: 30th Dec 2010
Location:
Posted: 11th Sep 2011 18:38
I'm making a vehicle side scrolling game and I've attached the wheels to the car frame using CreateRevoluteJoint. Combining this with SetJointMotorOn (my car's the 2D equivalent of 4 wheel drive so I do this for the front and rear wheels) I can get the car moving along the terrain. However, it also causes the car to rotate and I don't know how to stop this. The rotation occurs when the car is on the ground and when it is in mid air.

I'd appreciate any clues people could give me for this.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Sep 2011 02:36 Edited at: 14th Sep 2011 02:50
I have not played with these particular commands yet.
Maybe someone who has already given them a try come in and help soon.
If not, I will play with these in the morning and see what I can come up with.
Not sure if this will be of use on my current project (an astronaut shooter) but I need to learn how to use these commmands for other games I'll b making later.

Edit
Something unexpected came up and I had to run an errand this afternoon, so I was not able to make any progress on this.
I'll try something in the morning though for sure.

Andycb93
13
Years of Service
User Offline
Joined: 30th Dec 2010
Location:
Posted: 14th Sep 2011 14:32
Thanks for looking into it I'm still stumped but going to have another attempt in a little while
Andycb93
13
Years of Service
User Offline
Joined: 30th Dec 2010
Location:
Posted: 14th Sep 2011 14:53
Okay, I don't know what I've done but the car sprite is no longer being rotated by the wheels
Andycb93
13
Years of Service
User Offline
Joined: 30th Dec 2010
Location:
Posted: 14th Sep 2011 15:06
I now realise what I changed, I removed the motors on the Revolute joints that are holding the wheels. Instead I am now using SetSpritePhysicsTorque. However this doesn't allow me to set a maximum speed, only a force (torque) I want applied.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 14th Sep 2011 17:41
Quote: "Okay, I don't know what I've done but the car sprite is no longer being rotated by the wheels "

lol

Quote: "I now realise what I changed, I removed the motors on the Revolute joints that are holding the wheels. Instead I am now using SetSpritePhysicsTorque. However this doesn't allow me to set a maximum speed, only a force (torque) I want applied. "

Okay, it sounds like you have it under control now.
I am sorry I didn't get to it yesterday like I had said.
I'm glad you got it working on your own, and I'm sure you will get it working like you had planned if you keep trying different things.
These physics commands look awesome and will definitely make a game very dynamic.
I'll be working on something that can use these in my next project, because I want to learn how to use them all.

Andycb93
13
Years of Service
User Offline
Joined: 30th Dec 2010
Location:
Posted: 14th Sep 2011 18:01
Yeah I've now worked out the the acceleration without flipping the car and braking

Login to post a reply

Server time is: 2024-04-19 03:01:31
Your offset time is: 2024-04-19 03:01:31