Box2D Forums

It is currently Wed May 22, 2013 4:14 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Oval
PostPosted: Sun May 29, 2011 9:27 am 
Offline

Joined: Sun May 29, 2011 9:22 am
Posts: 6
Hi

Sorry but i'm a fully qualified noob when it comes to box2d and wck, and wonedred if someone could point me in the right direction.

I would like to make a oval shape roll. I am creating it in the FLASH IDE...creating a symbol etc. But how can i make this roll like an oval shape? I am assuming I have to do something to tell BOX2D the shape?

any help on this would be great

ade


Top
 Profile  
 
 Post subject: Re: Oval
PostPosted: Sun May 29, 2011 12:19 pm 
Offline

Joined: Sun May 29, 2011 9:22 am
Posts: 6
Ok silly me....I was used BoxMan as my class for my oval shape and assumed extending that class with Oval would work.

However if i just use shapes.Oval as my class for the clip i get the desired result:) Namely it rolls:)

However.....is it possible to make BoxMan extend Oval so i can use some of the core methods in there?

ade


Top
 Profile  
 
 Post subject: Re: Oval
PostPosted: Sun May 29, 2011 1:01 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
Just change this:

Code:
public class BoxMan extends Box


To this:

Code:
public class BoxMan extends Oval


Top
 Profile  
 
 Post subject: Re: Oval
PostPosted: Sun May 29, 2011 2:09 pm 
Offline

Joined: Sun May 29, 2011 9:22 am
Posts: 6
Hi

Thanks for the reply..

I have made that change to BoxMan. However that results in the oval not rotating when it moves, which is what is confusing.

If i keep the class as shapes.Oval it does rotate so I know theres nothing wrong my symbol etc.

any ideas on what could be wrong?

thanks in advance

ade


Top
 Profile  
 
 Post subject: Re: Oval
PostPosted: Sun May 29, 2011 2:11 pm 
Offline

Joined: Sun May 29, 2011 9:22 am
Posts: 6
Lol slaps head:|

Worked it out..i just noticed BoxMan has fixedrotation set to true....its been a long day:|

thanks for your time:)

ade


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 4 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