The Daily Click ::. Forums ::. Klik Coding Help ::. Box 2d + custom movement?
 

Post Reply  Post Oekaki 
 

Posted By Message

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
21st March, 2012 at 21/03/2012 07:16:57 -

Hello,

I asked this on the Clickteam forums but nobody had an answer for me.

I have created a top down driving movement engine from scratch. I would like to use my engine for the car movement and the Box2d extension to handle the collisions? eg. pushing other cars around, smashing into and bouncing off buildings, etc. Is this possible?

Or must I build my car's movement with the Box2d extension if I want to use the Box2d physics on my car.

 
n/a

nim



Registered
  17/05/2002
Points
  7233
21st March, 2012 at 21/03/2012 10:57:41 -

I was just thinking of making a game like this sometime

I suppose you could do it either way but making the movement and collisions with the same engine (i.e. build both with Box2d) would be less work in the long run.

 
//

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
21st March, 2012 at 21/03/2012 11:52:51 -

There is a remarkable driving engine built in Box2D, and it's in the examples. I second Nim's suggestion that you go with that engine and keep everything native in Box2D to make things easier on you.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
21st March, 2012 at 21/03/2012 13:58:35 -

Sorry, I am very inexperienced with Box2d... why would it be less work in the long run to do it all in Box2d?

I've seen various examples of driving games made the Box2d physics. They're nice, but not what I am going for. Plus, I've already finished my movement engine. All I need is to add collisions.


 
n/a

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
21st March, 2012 at 21/03/2012 17:13:46 -

I see your "very inexperienced with Box2D" and raise it to "I'm not experienced at all with it."

I just opened up the Box2D examples one day, marveled at them and thought of how cool it would be to make a driving game with it (the driving engine in particular, which I thought was super cool and well-done), and promptly forgot about trying to learn how to make it work for my own games. But in the examples I saw, there was a top-down driving engine that I figured you might want to work with; hence my suggestion. By not mixing-and-matching tools and extensions within MMF2, my assumption is that differences in coding behaviours wouldn't be so difficult to fix (or work around). In other words, trying to have a Box2D object interact with a non-Box2D object would not be a problem if simply everything was made to work with Box2D.

Obviously if it's not what you're looking for then yeah, skip it. But beyond reinventing the wheel and building something from scratch (which is probably why you've not heard any responses to your questions on the CT forums), I reckon you'll be hammering at this one on your own. The good news is that once it's done, you'll have an excellent example to share with others about the whole process.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th March, 2012 at 28/03/2012 15:20:21 -

Sorry to bump my own old thread. If anybody is curious, I did manage to combine my own custom car movement engine with the box2d object for handling collisions. I'm still working on it though, so no open source yet I'm sorry.

http://www.whenthereisnoroominhellthedeadwalktheearth.com/MMF/Drive.exe

I miss the days when no matter what my problem, there was always somebody who could help me, and usually very quickly too. Nowadays, I have to figure it out for myself. Hopefully, that means I am becoming a better programmer and setting more difficult challenges for myself. Or, you guys hate me....

 
n/a

nim



Registered
  17/05/2002
Points
  7233
28th March, 2012 at 28/03/2012 15:42:43 -

That's really good! Was it difficult to get your own movement engine working with Box2d?

 
//

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th March, 2012 at 28/03/2012 16:45:24 -

No, it was simple. But figuring it out was difficult.

 
n/a

nivram



Registered
  20/07/2006
Points
  171
29th March, 2012 at 29/03/2012 01:05:18 -

[quote]I miss the days when no matter what my problem, there was always somebody who could help me, and usually very quickly too. Nowadays, I have to figure it out for myself. Hopefully, that means I am becoming a better programmer and setting more difficult challenges for myself. Or, you guys hate me....[/quote]

Chris. I don't hate you. Since the "good ole days", the software has increased in complexity 20 fold. If people would stop asking questions about things over my head I would feel better. Crap, I have been using this software since 1999.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
29th March, 2012 at 29/03/2012 01:36:03 -

Haha I don't think anybody hates me. Well, nobody on these forums at least... I was just having a laugh.

I too started using in 1999. Got addicted hard. Mainlining Klik n Play right into my eyeballs.

I love the increased complexity, it really keeps my brain working. I try to check out every new example and understand exactly what is happening, especially in Sketchy's haha. I have a little snoop around his SkyDrive every couple of days, itching for something new. I'm not to fond of all the exporters though, obviously they are a good thing, just don't really apply to me that's all.

 
n/a

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2722
4th April, 2012 at 04/04/2012 20:06:52 -

Sorry I've no info on Box2D can't help, I think you're becoming the person who is giving the answers to the questions you used to ask. And that of course is a good thing.

I would probably have been stuck with a custom car movement engine if I had made one. But I think the advice here on having everything work as a Box2D object is a good one.

And as for your example, I like it, especially those lanterns. Wish I could code that in javascript, canvas & html5.


 
Image jenswa.neocities.org
   

Post Reply



 



Advertisement

Worth A Click