calculating force, velocity and distance in chipmunk - ios

I am newbie with Cocos 2D, Chipmunk and Box 2D.
I have started basic docs and started to develop games.
Currently I am working with chipmunk.
I stuck at few points And they are as follow.
In my application, there is a player Who kick the soccer ball and ball will move to distance according to force applied by kick of player.
I am confused for ..
How do I make players whole body static and can make his one lag moveable to let it kick the ball.
How do I calculate force and vector and distance etc.
How do i move to next screen if my ball goes to out of current screen.
Please let me know the url from which I can easily get all type of examples for chipmunk application.

First off, you should learn chipmunk first and then try to solve your problem. I see a lot of people just wanting their problem to go away without actually making an effort to solve it. Here's some google results on Chipmunk tutorials.
https://www.google.co.cr/webhp?sourceid=chrome-instant&ix=sea&ie=UTF-8&ion=1#sclient=psy-ab&hl=en&site=webhp&source=hp&q=chipmunk%20tutorials&oq=&aq=&aqi=&aql=&gs_l=&pbx=1&fp=37838802d5e34660&ix=sea&ion=1&bav=on.2,or.r_gc.r_pw.,cf.osb&biw=1680&bih=882
About the 3 questions:
If you learn chipmunk or box2d, you can easily go and test different settings, from static bodys to joints to density. Depending on what you want to do, the solution differs. I suggest you look into that.
You can use several functions on each body you register. For box2d, youd use body->getAngle(), body->getLinearVelocity(), and body->getPosition(). With these 3 functions you can calculater force, vector and distance from every object. Im pretty sure chipmunk has something like this.
Really?? PSEUDOCODE: if (ball.position OUTSIDE screen.bounds) nextLEVEL();

Related

Making a Platform game with Corona SDK

I'm trying to develop a platform game similar to Geometry Dash but i'm facing a lot of problems during the making of the algorithm.
I don't barely know how to proceed. Are the levels structured with a long image ( that is the ground) with obstacles added, or there are many obstacles generated progressively during the game?
I'd like to know where to start from, what to draw and how to place it in my game, how to build the collision detection.
The game will be an auto-scrolling platformer, so, will the character's asset be moving right or will all the level except for the character be moving left?
I'm a beginner, so i would like to receive detailed answers and not too difficult to understand. Thank you.
if you have any advice I would gladly listen to it.
I've done all corona tutorials but they doesn't explain how to do a platformer. - Luca Pasini
Looks like you still don't feel how game work from inside. Tutorials probably will not help you much. I think you need to start something very simple by your own - not by tutorials.
For example:
Show red rectangle
Show blue recatngle
Tap on the screen and red rectangle must change his position (not by transitions - just by core x,y change)
If they are collide - show text: "You win". Collision check just by raw calculations.
Then go with updates, that will make it looks more like a game.

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

How should I do this (Game)?

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.

Making a table tennis game

I am very interested in making a table tennis game. It will be in 2D specially as I have no experience dealing the 3D. I have built aero-fighter in java. No i am learning XNA and want to make a table tennis (ping pong) video game in it. It will be human vs computer game.
I have some idea to do the task. But I am eager to know how the tennis game industry move their player ?
There are several question about the game --
***What will be the best to create such a game in 2D or 3D ?
How can i move the ball in 2D game? The equation of the ball move for top,under,flat shot or spin?
How can i move my player?
How can i spin the bat of player and the ball?*
First of all my idea is , making a sprite sheet of some special move for such -
Forehand counter hit, Backhand counter hit, Forehand push, Forehand serve, Backhand Serve... etc.
But it seems to boring and time consuming a lot. What is the best idea to handle such things or this problem?
I do not know the idea to movement of the tt ball. How can i use the spin in the ball and how can i show the spin -- Is it with the sprite?
Please help me if anyone know anything about it. I also like to have some links to get the concept of the video game....
I recomend you get confident with 2D games before you start with 3D. 3D is much more complex and your unlikely to get anywhere if you try to run before you can walk.
The rest of your question is a little broad to answer properly, I suggest you go through the tutorials on app hub and raise a new topic if you need help with a specific part.
If you become familiar with a physics engine such as farseer (harder to initially learn, better in the long run) or Physics2D (easy to pickup, but a little limiting) you could create a pong clone in under an hour I would say.

Resources