XCode: Capturing swipe gesture and creating a moving object - iphone

Newbie in XCode & IPhone development.
I'm trying to create a game, where throwing an object (using a swipe gesture) will move the object to the direction requested and will continue with momentum until the border of the view.
Anyone has some code snippets (or links) I can look into for examples?
Thanks.

Take a look at cocos2D-iphone for animation and physics.

Related

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

Doodle Jump game over animation

Please excuse the stupid question, but I'm working on a game because I'm crazy like that and I really need some help. When you fall below the screen in doodle jump the game is over and it cuts to end of game animation. This animation gives the feel of the screen scrolling and him falling -- some how they animate him to the top -- from the top to his death. Do anybody know who to simulate this animation? BTW, I'm using Cocos2d for the game engine.
I did find the answer my self by using this tool called File Juicer. Check it out it very good.

I want background of my cocos2d game to be the view of the camera of iphone. How do i do that?

I am making a game with augmented reality in it. So, i want to have the camera view as the background of the game. However, I am finding some difficulties in doing this.
I tried doing it using the UIImagePickerController but then when i do that, all i get is the camera view and the game elements disappear.
I looked at some of the articles..
http://www.cocos2d-iphone.org/forum/topic/1752
http://www.cocos2d-iphone.org/forum/topic/711
but i didnt get any proper answer and it only confused me more.
Can anyone help?
Thanks.
http://www.raywenderlich.com/3997/introduction-to-augmented-reality-on-the-iphone

How to implement horizontal scrolling in box2d?

I'm working on an iPhone game using box2D and I need to implement horizontal scrolling... I was able to scroll the background textures and all... But, the problem is that, I'm not able to scroll the physics world of box2d... Please help me, how to move the box2d world... I'm not using cocos2d... I googled a lot, but was not able to find any solution without cocos2d...
Regards,
Suran
You should not move the world. Instead, try moving the "camera" (clip area) accordingly with the game character.
Try following: in touchesEnd Method:
[self.parent runAction:[CCMoveTo actionWithDuration:.5 position:ccp(yourPosition,0)]];

When there is a touch in a CGRect, do something (Cocos2d Question)?

I am new to Cocos2d and I am making a game with a SneakyJoystick and a SneakyButton. The SneakyJoystick works fine, it moves the sprite character around the screen. But the SneakyButton is a problem. How do I implement shooting another sprite from the characters position when the SneakyButton is pressed? Do I modify the SneakyButton.h and SneakyButton.m? Or do I recreate the code in the HelloWorldLayer.h and HelloWorldLayer.m? This is extremely confusing and please remember that I am using a SneakyButton, not a button that I programmed myself. Thanks!!!
No, you don't have to modify the code. You just include the SneakyInput code in your project. Then import the SneakyButton headers in your class. Create the instance of SneakyButton and add it to your layer. Then you can just query the state of button if it is pressed or not.
Its very simple, just follow this tutorial from link below,
http://www.qcmat.com/sneakyinput-joystick-dpad-and-buttons-for-cocos2d/