hi
I'm am aiming to make a platform game in the style of Mario and would like to know if going to the extra length of using one of the physics engines is worth it. I mainly need it for jumping and collisions, if the physics way is the way to go, is chipmunk or box2d better/simpler? or is it just personal preference?
thanks
Box2d/chipmunk or not for jumping
(8 posts) (5 voices)-
Posted 1 year ago #
-
i would think person preference.
to be honest. I do all my coding in box2d. Haven't worked on a game yet (you know, besides following tutorials) that didn't use it. in my mind, the HUGE benefit of using box2d even just for simple games is the built in contact detection and contact filter you can implement. It amazes me what i could do once i discovered that contact filter.
I couldn't imagine making a game in just cocos2d ever :)
Posted 1 year ago # -
Is there any collision detection in chipmunk?
Posted 1 year ago # -
i dunno, i never used it. I learned using Ray Wenderlich's tutorials, which are all box2d
Posted 1 year ago # -
If you are going to make a platform game based on a physics engine then you need to look at LevelSVG. You can download a demo from the AppStore to see some of what it is capable of.
Posted 1 year ago # -
Hi,
I'm also creating a platform game, I'm using Box2D for my platform collisions, some of my in-game sprite collisions (being able to move boxes, crates etc) - it is great. I do just use the rect method to detect when my player touches another sprite within the game so I could use the CCSprite actions. My player is moved by using impulses, this goes for the jumping also and as gravity is being used, my player falls to earth for free ;-). Remember also, when using Box2D you can apply friction to your platforms, in one of my levels, the platforms are ice cubes, so, the friction is none and thus it feels like the player slides along.
As for LevelSVG, that looks great, I've not purchased it as yet due to financial reasons so I've just written my own SVG parser which works fine for my usage. I do know people who have bought and used it and it has saved them lots and lots of development time and made their games easier to develop.
Regards,
StevePosted 1 year ago # -
I think it depends on the specific requirements for the game.
If you're building a simple platformer where you jump around and get from point A to B with simple things like jumping on enemies and no crazy things going on.. Just using Cocos2D will suffice. When I got into Cocos2D I first though, "First thing I need to do is write custom helper classes and libraries to add functionality" and shortly after realizing Cocos2D can ALREADY do that. Cocos2D is extremely powerful; however, don't get me wrong.. Box2D/Chipmunk are fantastic physics engines. They do complicate things a bit, but they're fantastic nonetheless. Having them in a project can really bump up the fun.
Now, if you want to do things like different levels of friction on platforms, throwing objects around, collision-based event systems, etc. adding a physics engine will make your life so much easier. It will take time getting used to the fact that you need to go through your physics system in order to make Cocos2D's sprites do stuff (in most cases), and you'll need to learn to respect your physics engine's rules but once you get used to it the type of games you can make will open up.
With all that said, LevelSVG makes all of this even easier. It's not cheap... and personally it's not something I would use but it's definitely a good step for someone wanting to make a platformer with a physics engine to back it up to make it feel realistic.
-robodude666
Posted 1 year ago # -
thanks for all your replys, i think i will go with Box2d (only because i have a little bit of experience with it) and will just slowly work my way threw it, will be a learning experience none the less
thanks again.Posted 1 year ago #
Reply
You must log in to post.