After I completed Adlib I started to play around with a bunch of different technologies. I wanted to try out new technology and new ideas and see what came up. One of the things that interested me was more realistic physics simulation. With Fluster I wrote a simple physics system to accommodate the platforming elements, but I knew that if I wanted to have deeper interactions I would need a real physics library. So I took a look at Box2d. Here’s the prototype I made and some thoughts about using Box2d.
Volcanic Prototype
This movie requires Flash Player 9
Controls (read this as they are weird):
- Move player 1 w/ ASWD
- Move player 2 w/ JKIL
- Restart things w/ R
So basically I was thinking about a collaborative-style platformer. The prototype gets its title from the idea that you would try to stay above the lava at all times — the lava is currently turned off. In order to encourage teamwork I have the camera try to track both players, and when a player moves off camera you get a little bubble showing you what he’s doing. So, while you could go up ahead and try to grab the treasure before your pal if you aren’t careful you’ll fall in the lava!
Box2d is a good library. It takes some time to figure out how the hell you actually put things together and use them in a game, but once you’ve figured that out you get a pretty complete physics package. My biggest gripe, and what’s still holding me back, is that it’s quite difficult to integrate Box2d into your content creation pipeline.
For my games I tend to use Flash CS4 to lay out the levels, etc. When all you have are simple rectangles, such as in Fluster, it’s pretty easy to map the sprites you create in Flash to physical objects in the game. However, because Box2d supports so many types of entities its actually much harder. That’s why you only see circles and rectangles in my prototype — making an arbitrary convex shape, a joint, or a spring would be hard!
Anyway, if you only want circles and squares then I think Box2d is a sensible choice, and you should be able to integrate it into your workflow relatively easily. Later I’ll try to look at some tools I found to solve the problem when you want to include more complicated types. For now I hope you enjoyed my prototype!
Related Posts
Box2d and Flash
After I completed Adlib I started to play around with a bunch of different technologies. I wanted to try out new technology and new ideas and see what came up. One of the things that interested me was more realistic physics simulation. With Fluster I wrote a simple physics system to accommodate the platforming elements, but I knew that if I wanted to have deeper interactions I would need a real physics library. So I took a look at Box2d. Here’s the prototype I made and some thoughts about using Box2d.
Volcanic Prototype
Controls (read this as they are weird):
So basically I was thinking about a collaborative-style platformer. The prototype gets its title from the idea that you would try to stay above the lava at all times — the lava is currently turned off. In order to encourage teamwork I have the camera try to track both players, and when a player moves off camera you get a little bubble showing you what he’s doing. So, while you could go up ahead and try to grab the treasure before your pal if you aren’t careful you’ll fall in the lava!
Box2d is a good library. It takes some time to figure out how the hell you actually put things together and use them in a game, but once you’ve figured that out you get a pretty complete physics package. My biggest gripe, and what’s still holding me back, is that it’s quite difficult to integrate Box2d into your content creation pipeline.
For my games I tend to use Flash CS4 to lay out the levels, etc. When all you have are simple rectangles, such as in Fluster, it’s pretty easy to map the sprites you create in Flash to physical objects in the game. However, because Box2d supports so many types of entities its actually much harder. That’s why you only see circles and rectangles in my prototype — making an arbitrary convex shape, a joint, or a spring would be hard!
Anyway, if you only want circles and squares then I think Box2d is a sensible choice, and you should be able to integrate it into your workflow relatively easily. Later I’ll try to look at some tools I found to solve the problem when you want to include more complicated types. For now I hope you enjoyed my prototype!
Related Posts