How should I do this (Game)? - ios

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.

Related

How to make a 2D model(moveable) like gomoji app?

I want to make a 2D model in iOS programatically. Like this:
This is taken from the app Gomoji.
I googled it but not get the proper solution.
This character is also moving so it can move hands and the legs meanwhile I want to change the colour of the hands etc.
Could it be possible with SpriteKit, SceneKit, gif, SVG or anything else?
This is an incredible amount of work in code, with SpriteKit and actions.
You might be better off using the puppet features of After Effects to creation motion frame sequences, and then bring them into SpriteKit and string them together and jump between the sequences as necessary.
Start here, to understand the puppetry tools in AE:
https://helpx.adobe.com/after-effects/using/animating-puppet-tools.html
Once you've learnt the lingo, head on over to youtube to pick up tips on how to do 2D arms, head wobbles, etc.
There's also a face animator in the latest versions of After Effects, that might be helpful, too.
Generally speaking, this is still a lot of work. And a lot of fiddling to get it to look "just so". But doing this visually, with manual mouse controls and instant playback before exporting image sequences from AE will be lightyears faster than attempting to do this with joints and code in SpriteKit or any other game engine.

SpriteKit: Should I pan the camera or move the background?

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.

Physics engine or not for making a Pendulum in iOS?

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).

collision detection and creation in xcode class

I'm working on making a new app in xcode and have run into two problems that always seem to be a problem when I program large projects.
Basically, I want the user of this app to be able to input specifics like size, position, color, and possibly speed and/or direction.
These inputs will create a square of specific size, position, and color which will move around the screen and interact with other squares the user has created.
Now here are my problems:
First: I have absolutely no idea how to create something in code. I know I almost certainly have to do this in a class, but I've never figured out how to do this in a single programming language.
Second: Interaction between the squares. How do I detect collisions between the possibly dozens or hundreds of squares the user creates.
I'd really like to figure out how to do this, especially because I'm sure it'll be helpful in not only this, but many other future projects.
Thanks
I would recommend using sprite kit for the collision detection and creation of the squares. You'll probably want to subclass SKSpriteNode to define the properties for your squares.
https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Introduction/Introduction.html

iOS + Cocos2D: Simple Colission/Bounce (do I need box2d/chipmunk?)

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.

Resources