Box2D Forums

It is currently Sat May 25, 2013 11:41 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Wed Dec 16, 2009 7:51 am 
Offline

Joined: Tue Feb 24, 2009 3:06 am
Posts: 3
be_design wrote:
Hi!

I have been looking for a good rope sim for a while now! I need it for a project that I'm working on. This one is GREAT! I think it might be what i need to make it happen.

Someone wanted a working version... the above code just needs a bit of tweakin to get it to render. Need to:
-= addEventListener(Event.ENTER_FRAME, updateSimulation, false, 0, true) to the constructor (or anywhere really)
-= change updateSimulation() to:

Code:
public function updateSimulation(e:Event):void
      {
         mouseDrag();
         world.Step( timeStep, iterations );
      }


-= create a .fla with this in the first frame:
Code:
import <point this to your copy of the "MobilePhysics">.MobilePhysics

var oSprite:Sprite = new Sprite()
addChild(oSprite)
oSprite.x = 100
var mobileTest = new MobilePhysics(oSprite)
oSprite.addChild(mobileTest)


Hope this helps!
Thanks for all the great work you guys/gals are doing.
-=b=-


I did your steps but it didnt work

"1046: No se encontró el tipo o no es una constante en tiempo de compilación: Event."


Top
 Profile  
 
PostPosted: Wed Dec 16, 2009 3:33 pm 
Offline

Joined: Fri Jan 30, 2009 4:37 pm
Posts: 7
Hi all,

Some of you have been mailing and messaging me about how to use the class I posted a while ago.

To explain, I have created a simple implementation attached to this post. The main added value is it shows how to use the Physics simulation to draw your custom graphics, which happens in the Rope class.

It is in the form of a FlashDevelop project, which is an actionscripting environment I can highly recommend.

The package is structured like this:

/flash/project - FlashDevelop project files
/flash/as3_src - the source code

/site - the compiled SWF with html files etc

You could probably also compile this using the Flash IDE somehow, I forgot how that goes though :)

Good luck :)

Erik


Attachments:
File comment: Example implementation of my rope
box2d_rope.zip [240.15 KiB]
Downloaded 570 times
Top
 Profile  
 
PostPosted: Tue Feb 09, 2010 11:26 pm 
Offline

Joined: Mon Nov 16, 2009 4:20 am
Posts: 4
OMG amazing class very very thxx!!! :o :D

you are the best!


Top
 Profile  
 
PostPosted: Mon Mar 08, 2010 12:22 pm 
Offline

Joined: Sat Nov 28, 2009 4:29 am
Posts: 29
could you explain a bit how the class works.
i trying to make it work that i could pass two instance names and the rope will be drawn between them.
thanks


Top
 Profile  
 
PostPosted: Wed Jun 23, 2010 8:48 am 
Offline

Joined: Wed Jun 23, 2010 8:43 am
Posts: 1
it's a wonderfull rope
I need some help...
How can I put a clip in the extreme of the rope and not the star?


Top
 Profile  
 
PostPosted: Wed Oct 27, 2010 5:47 pm 
Offline

Joined: Wed Oct 27, 2010 5:44 pm
Posts: 2
Hello all,
I can't seem to see any graphics in this simulation without turning on debug mode.
I must admit i'm a Box2d novice, so maybe its a simple fix?
What i'm trying to do is to add my own 'star', and give the rope a colour.
Any help is appreciated
Thanks,
James


Top
 Profile  
 
PostPosted: Mon Jun 06, 2011 2:07 am 
Offline

Joined: Mon Jun 06, 2011 2:01 am
Posts: 1
Hello,
How to use this in a fla? I dunno how to implement it because i cannot see a fla file and how to work with it...
I want to be able to import this as a swf in my main movie...
Any help appreciated.. Thanks


Top
 Profile  
 
PostPosted: Tue Jan 10, 2012 12:12 am 
Offline

Joined: Tue Jan 10, 2012 12:09 am
Posts: 2
First of all its great to share the code to everyone.. however, i have 1 question in mind.

How to increase the width of line and how to draw the image along the line instead black rope ?

anyone's reply will be really appreciate.

Thanks..

Pardon my English.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 8 hours [ DST ]


Who is online

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