Box2D Forums

It is currently Tue May 21, 2013 5:03 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Box2D with iPhone
PostPosted: Fri Nov 13, 2009 10:17 am 
Offline

Joined: Fri Nov 13, 2009 9:56 am
Posts: 1
Hello, I'm new to Box2D and am wondering if this is going to be the right application for me. I'm impressed with the collision detection and built in physics, but it's been a little confusing for me.

I'm trying to make a game for iPhone using Box2D and I'm using the accelerometer to move an object around a top-down view map. Think labyrinth almost, but with a slower moving character. Is something like this possible with Box2D? I've been trying to tweak the gravity, but I want the character to turn and change directions a lot quicker. Are there any good tutorials out there?

Thanks for the help


Top
 Profile  
 
 Post subject: Re: Box2D with iPhone
PostPosted: Sun Nov 15, 2009 7:23 pm 
Offline

Joined: Wed Nov 11, 2009 6:25 am
Posts: 44
Thinking of it from a gameplay standpoint, I would say that the slow change of gravity would add to the difficulty. Buuuuuuuuuut, if you really wanted to change the gravity quicker, you could set tthe game to read the accelerometer and then set the gravity using a scalar and then adjust that. For example, if you were holding the phone like a GBA and tilting it (which is what I'm assuming you are doing), you could set gravity to:
Code:
gravity_x += accelerometer * 0.05f;
gravity_y += accelerometer * 0.05f;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group