Would a game with a man walking on a planet be a tile based game? - iphone

Say there was a game, where you stay on a single screen (unless you pass the level), and you are a man walking around in space.
It seems like a tile based game to me, the only catch is that when you move, it has some physics at play, meaning the more you press up, the faster you move and the longer it takes to slow down.
And you also keep moving even if you stop pressing the arrow keys as you have gained momentum.
thoughts?
how would I handle the movement of the man based on momentum etc?

If you decide to use Cocos2d, start with this
Learn iPhone and iPad cocos2d Game Development
It has an example in the chapter "Your First Game" which covers Velocity calculations and controlling a players movement using these calculations.
Also as bbum mentioned
Ray Wenderlich has some great tutorials and is really educating developers on some interesting topics.
He also has co-authored a book which is available for pre-order.
Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk

Sure; it could easily be a tile based game and there are multiple examples of exactly that. Heck; Super Mario is a tile based game -- the level and backgrounds are all tile based layouts -- with the characters -- also tiles -- moving based on a very simple physics model.
Cocos2d is a tile based game engine that also has support for several physics engines.
Ray Wenderlich has written an excellent series of tutorials on uses of cocos2d. Here is one that includes physics to model a bouncing ball.

Either you have a game like lunar lander, where the position of the man is based on physics, or you have a tile based game. You cannot have both at the same time.

Related

Kind of platformer game in Spritekit

I read that using a physics engine can be the cause of many problems in programming platformer type of games.
I am making something similar to the platformer game(not a classic platformer).
Game will have a platforms, but not many.
Game will not have moving platforms
Game will not have slopes
Game will have ladders
Hero can shoot the enemies
Hero can jump
Hero can access ladders from the air
I have to choose between physics engine and tile tehnique...
The first problems I can think of are:
problem with physics engine and the ladders because physics rules are applied to hero and his movement,so I guess it would be hard to get him on the ladders while his physicsBody.dynamic property is set to YES.
problem with the tile tehnique - how to make hero falling from the ledge(while running) with an realistic arc (when we use physics this is done by engine itself...)?
And the main problem, based on the type of the game I am making, is, sholud I combine tiles tehinque(let's say for hero's moving) and physics engine for collision detection, and shooting enemies?
I know there are a lot of questions about this subject, but I must start from something...
Tnx in advance
I would recommend the physics engine. It is very straight forward... what you expect is generally what happens.
Run, Jump, Shoot, Fall, etc. - Very easy to do using the physics engine.
Ladders will be problematic but you could set a bool flag that lets you know when the ladder and hero are touching, therefore allowing you to exhibit different behaviors depending if this bool is true or not. Ex. Make hero not affected by gravity if touching a ladder.
It is very smart that you are planning this out ahead of time and have outlined all of your core requirements. IMHO, the rest of the requirements will be so easy using the physics engine that it will outweigh additional time spent on the harder part with ladders.
I would advise against using a physics engine unless you have some complex physical interactions that would be difficult to code by hand, i.e. not just collision detection and basic movement but things reacting realistically to collisions, mechanical objects made of many moving parts and joints, etc. I'm not sure what you mean by a "tile technique", but you can easily code by hand things like a character accelerating towards the ground while maintaining forward momentum (i.e. tracing an arc).

Bouncing Particles in a CCParticleSystemQuad

I'm using cocos2d to make a game on iOS. I have a particle emitter that I want the particles to bounce when they hit the bottom of the screen. Thing is I cannot seem to find a way to do this and with my limited understand of open GL the answer my be obviously in front of me but I don't see it. Is there an example of this or a way to use the CCBounce or box2d or something?
Here is a bouncing ball tutorial which uses cocos2d + Box2D:
http://www.raywenderlich.com/457/intro-to-box2d-with-cocos2d-tutorial-bouncing-balls
There is also EaseBounce actions (CCEaseBounceIn, CCEaseBounceOut, CCEaseBounceInOut) in cocos2d for you to run on sprites. See "EaseBounce actions" section in "cocos2d Programming Guide: Actions - Ease".

cocos2d game sample based on gameloop?

I want to develop 2d game through Cocos2d.but i could not find
any tutorial based on the following.I want one game loop and one draw screen.can I do Multiple sprite animations within one scene..(translating World etc).where can i find tutorial how to use those classes which are coccos2d?
-(void)gameloop
{
calculation();
drawImage();
drawImage1();
}
It is quite simple, you do not have to know opengl essentials to use cocos2d. cocos2d is quite simple yet awesome!. Just download the cocos2d 0.99.5 and it comes with sample tests. You will be able to find almost all of the things you want to do in a game i.e. animations, touches, moving sprites, particle system etc etc
so just go to:
http://www.cocos2d-iphone.org/
How to learn OpenGL by example, say, building a rotating globe?

Conceptual iPhone 2d game dev question. Quartz? Cocos2d? Chipmunk? Box2d?

I am new to iPhone dev and would like to write a game that involves 2d collisions. Would somebody give me a conceptual overview on how the various frameworks interact in a typical 2d collision game?
The candidates I see mentioned so far are 2d packages such as quartz and cocos2d and physics engines such as chipmunk and box2d. What I am not extremely clear is the relationships among these in my context.
Thanks in advance for answering!
Quartz is a 2D graphics API by Apple. It's usually not used for performance-intensive games, because you can get better performance by using OpenGL directly or by using some thin framework made for games. (Which is what Cocos2D provides.) The collision stuff is independent on this debate, since the collisions are usually calculated without knowing anything about the graphic representation of the colliding objects.
The relationship between collision (or general physics) engines and the graphic layer is exactly the relationship between a model and a view in the MVC pattern. In each frame you move the physical world a bit forward (physics) and then you draw the objects on their new positions (graphics).
In reality the model and view sometimes blend a bit to make things faster, but in principle they are completely separate things. Which means you can pick any of the possible combinations of OpenGL, Quartz or Cocos2D as the graphics engine and Box2D or Chipmunk as the physics engine and get a decent game. I'm not sure how well do the particular combinations work in practice - if that was your question, then I've just wasted a few minutes of your life :-)
zoul got it right, I would just add this :
Cocos2d for iPhone provides samples including Box2D and Chipmunk if you want to try them and see how easy or hard they are to use. So you can go ahead and download Cocos2d, then play with the samples a bit to see if it fits your needs.

chipmunk stack fall effect

I am using chipmunk cocos 2d iphone ,in which i have to show stack fall effect when the objects are placed on the edge of other
object.My idea is to develop the effect like "Tower Box " game. I would like to know which properties of shape or body will create effect like "Tower Box " game .please let me know how can I fall that stack.
Cocos2d provides you with a few preset project options.
One of these is Cocos2d with Box2d, another is Cocos2d with Chipmunk. It is completely up to you which physics engine you use, I have experience with both and personally, would recommend Box2d.
If you create one of these projects, it generates some example code for you, and in the case of Box2d (i haven't used an auto generated chipmunk project), you get a nice little app that spawns loads of boxes and shows them falling with gravity. You should take a look at the code behind creating the physics bodies on the boxes and adapt it to suit your application (spawn a box at a touch location, perhaps?). You could then add some logic that checks, on collision, the alignment of the falling box with the top of the stack, and either let it continue falling, or use a fixture to attach it to the box below.
For more information about using physics in a cocos2d app, as well as general cocos2d usage, check out this blog, it's what taught me in the beginning: http://www.raywenderlich.com/ [edit: just noticed there are no chipmunk tutorials on there, but the theory should be applicable to both. I found Box2d easier to use than Chipmunk]
What physics effects have you got on the stack so far? What problem have you encountered that made you question the physics properties of the objects?
For these effects you need a physics library. For 2d games box2d is quite good.