Box2D Forums

It is currently Thu May 23, 2013 1:48 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 09, 2011 11:19 am 
Offline

Joined: Wed Feb 09, 2011 11:15 am
Posts: 2
Hi all,
I've created a circle shape extending the shapes.Circle class, and I'm using the BodyShape as component, it's a pinball ball, and at certain point of the game I want to reset its position to the start of the game but seems like I can't set the x and y properties of it...How do I do that from my main class?

Thx!


Top
 Profile  
 
PostPosted: Wed Feb 09, 2011 1:04 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
remove it from the world, set the x & y, then add it back to the world.


Top
 Profile  
 
PostPosted: Wed Feb 09, 2011 2:46 pm 
Offline

Joined: Wed Feb 09, 2011 11:15 am
Posts: 2
Tx! But how exactly I do that? I've been trying several ways and can't get it to work!
I want to reset it when it hits a wall, so I've used a ContactEvent then tried destroying it, but it always get me some error...

Edit:
Nevermind, got it working!
Apparently I just had to use myWorld.doOutsideTimeStep.

Tx!


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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