So I am writing a simple game and need to do collision detection. Basically balls are going to bounce off each other as well as walls.
Do you think chipmunk/box2d would be overkill for this? Or can I just implement the algorithm myself?
I'm a huge fan of Box2d so I'd recommend using that. Your simple game may start of simple but if you ever want to do more then you are all setup. Also, once you implement it and get the basics down you'll be amazed at how simple it is. If you decide to go with Chipmunk though, I've heard a lot of good things about Space Manager (http://code.google.com/p/chipmunk-spacemanager/) as far as being really easy to implement, but I have not used it myself.
Check out: http://www.raywenderlich.com/457/intro-to-box2d-with-cocos2d-tutorial-bouncing-balls
for a great tutorial
Detecting collisions of the balls will be easy. Making them bounce realistically is the difficult part. The more realism you want/need, the better off you will be using a physics engine.
Related
When building a game with SpriteKit, with a platformer game (like Doodle Jump for example), is it preferable to move the camera up, or the background nodes down ?
What is the standard practice in other frameworks ?
MOVE THE CAMERA!!!
One of the weirdest things about 2D game engines is that it often takes them a series of versions to get a camera.
They should be born with them.
SpriteKit was no different, it took forever to get a camera.
Now that it has one, never ever think of not using it.
Will make your life a million times simpler.
I can think of no exceptions, but look forward to being proven wrong.
move background was HOTFIX until proper cam support added.
use the cam. its easy and fun. no reason to not imo.
I'm trying to replicate the pendulum effect as seen in the old game "Gold miner", if you ever played it before. Do I need to use a physics engine for that, or not? I heard that Box2D is preferred over Chipmunk when it comes to ropes, but do I really have to join two objects together with a rope to accomplish this pendulum effect? I'd love to do it without a physics engine, but if I have to use one I think I would pref chipmunk as it comes with Cocos2d v3. (In short, whats the best way of making a pendulum that swings forever and can be lowered and raised)
Im' a complete n00b when it comes to physics engines, never used one before, only made non-games apps before :/ Any help is very appreciated =)
You mean the grappling hook in that game? That's absolutely not physics, or at least can be done easily without a physics engine. At best you may want to use the physicss engine's raycast collision detection methods (if any).
I want to develop an Angry Birds style game (more for learning purpose), so I am digging into Cocos2D + Box2D and after having done a few test all by code I am wondering which tool can I use to design level easier ?
A bit of google pointed me out Tiled or R.U.B.E. but I am not really sure if it's what I need. Tiled seem to be more designed for tiled game like a plat-former and I don't really know about R.U.B.E.
What I'd like to do is being able to place my body manually in a scene, set their physic property and so...
Which tool would you recommend for this kind of level design ?
Thank in advance.
I advise you to download/buy LevelHelper/SpriteHelper, they have helped me a lot when I was a novice with box2d. I think it's just what you need, once you learn the basics then you can go forward freely without them. In addition now there's also one or more tutorials on the Ray Wenderlich site that will help you even more like this (The softwares are not free, but in my opinion they worth their price)
Ignoring price for the moment, would using Unity for a 2D game be better than building one natively in iOS, i.e. faster and more powerful because of the underlying OpenGL usage, or is it either not supported well, complete overkill, not much better than just using UIImages and/or Quartz, or for some other reason worse?
Depends on the game. If you have under 100 or so sprites, you can just use UIViews without any big issue. Over that and you're starting to get in the realm where OpenGL will matter.
If I were doing a game with with lots of sprites or particles, I'd certainly look into Unity. Then again, I'd also look into Cocos2D. (I'm not directly familiar with either, my games are all UIView-based.)
Building any game using Unity instead of just UIKit/Quartz has the advantage that it will be easier to port it to other platforms if you want to.
Right now I have coded about 80% of my game and the remaining 20% is the actual game part of it. I need to know how I should go upon actually making the game part.
Pretty much it will be somewhat similar to Doodle Jump. There will be gravity, the accelerometer, and a spawn system for platforms. I need to know if I should use UIKit or Cocos2D for this.
I know I can do gravity and use the accelerometer easily using UIKit but I am worried about the platform part. My 'Doodle Jump character' is not a regular square or rectangle so should I just crop it as best I can? The reason I am worried is because say the character falls on a platform, so his body could be a little off since CGRectIntersectsRect does not have pixel collision detection, so do you think it is fine the way it is?
If you need more info or aren't sure what I am trying to do, just let me know. In the end I just need to know if I should use Cocos2D or UIKit.
Please let me know your thoughts.
Thanks!
My answer would be that, while you may be able to develop the game in UIKit, my suspiction is that it will be better in the long run to do it in Cocos2D. Not only will you have tools which are better for doing stuff like collision detection, you can also use a Physics Engine to handle the gravity and things like that. Basically, Cocos2d was made to do exactly the kinds of things you want to do, and UIKit wasn't...it was made for user interfaces.
Still, the collision detection you do will, mostly likely, not need to be down the level of individual pixels. One rectangle might be enough, or perhaps you can use several to get more accuracy. So can you pull it off in UIKit...maybe, but I bet your game will turnout better overall if you use Cocos2d.