cocos2d is a free open-source framework for building 2D games, demos, and other graphical/interactive applications.
-1
votes
1answer
807 views
How to make Moving road/track for android game?
I am very much new to Android game development. and i have little idea about the canvas and open GL. in one of my requirement i wanted to draw a moving road/track(Jazzy). how should i start. please ...
1
vote
1answer
461 views
How can I scroll sprites when swiping using Cocos2D?
I'm adding 3 sprites (layers) to CCParallaxNode:
BGLayer = [CCSprite spriteWithFile:@"Layer.png"];
[_backgroundNode
addChild:BGLayer
z:2
parallaxRatio:layer1Speed
...
2
votes
1answer
5k views
cocos3d versus Unity for simple IOS 3D games?
Wondering if anyone here happens to have experience in doing some simple 3D based games/apps for IOS, using cocos3d & Unity and could give some pointers....questions I have are:
GENERAL
1) It ...
1
vote
2answers
2k views
Cocos2d Composition using CCSpriteBatchNode
I'm making a game in objective-c using cocos2d. I have the following:
@interface Player : CCNode
{
CCSprite *mySprite;
CCSpriteBatchNode *sceneSpriteBatchNode;
//...
}
@property ...
1
vote
0answers
389 views
How to Store the game score in android cocos2d
I calculates the score in game project using android cocos2d, in that game after finishing the first level it goes to the next level, so i want to store that first level score and also add next level ...
4
votes
1answer
3k views
How to create endless scrolling landscape using coco2d's CCParallaxNode
I created a horizontally scrolling landscape using CCParallaxNode. However it does not seem to support endless scrolling in one direction. As soon as the first image "ends" the background shines ...
2
votes
1answer
1k views
Objective-c Cocos2d moving a sprite
I hope someone knows how to do the following with cocos2d:
I want a sprite to move but not in a single line by using
[cocosGuy runAction: [CCMoveTo actionWithDuration:1 position:location]];
What ...
-4
votes
1answer
147 views
How can I initialize 15-20 sprites with the same starting position?
How can I load 15-20 sprites in Cocos2D at the same point (ccp(20,20), which is an alias for CGPointMake) using NSArray?
This is what I'm doing now, and it doesn't work:
int i,endvalue=3;
...
1
vote
0answers
396 views
How to create a collidable map with tiled for cocos2d (Android)?
I am using cocos2d to create a game for Android.
I am making a map in Tiled Map Editor and added a property to the ground tiles.
The property name is Collidable and its value is True.
Now I have ...
0
votes
1answer
7k views
Cocos2d android game samples? [closed]
i just know the start the game development in android using Cocos2d.I start the basic from this link
http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/
but i didn`t get ...
3
votes
1answer
1k views
In cocos2d's plist output, what are 'offset,' 'colorSourceRect,' and these other fields?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
...
0
votes
1answer
845 views
How do I implement a subclass of CCSprite?
Can someone tell me how to subclass CCSprite on Android?
I've added this snippet of code into my CharacterSprite:
public static CharacterSprite sprite(String fileName) {
return new ...
-1
votes
1answer
406 views
How can I solve these errors when using SimpleAudioEngine?
I want to use SimpleAudioEngine for the music in a cocos2d game I'm working on. When I import SimpleAudioEngine.h in my game layer I get syntax errors in CVPixelBuffer.h and CMFormatDescription.h.
...
-4
votes
1answer
228 views
Why does this CCSprite subclass code throw an exception?
I have one problem in inheriting CCSprites in Java. Here is part of my code:
public class Block extends CCSprite
{
static Block temp=null;
static Block newBlock(tetrominoTypes blockType)
{
...
4
votes
4answers
367 views
semi 3d walls, should I use sprite sheet or render them 3d?
I'm going to develop a game and this is just a prototype of it's graphics.
Knowing that my primary target platform is iPhone, I'm wondering if it's better to create a spritesheet containing all ...
1
vote
1answer
786 views
Detecting right/left collisions with a bounding box
I'm building a platformer in cocos2d, my first game project. I'm working on movement and collision detection. I'm using a tilemap with a "meta" layer of invisible blocks that are designated ...
0
votes
1answer
317 views
How useful would it be to know a scripting language when developing an iOS game? [duplicate]
Possible Duplicate:
Why do we use scripts in development?
I just starting learning iOS game development. I plan to make games using the cocos2d framework. While reading game dev related ...
-2
votes
1answer
2k views
Objective-C to Java conversion for porting iPhone apps to Android?
can anybody help me to convert this objective-c code to android java.
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if (_mouseJoint != NULL) return;
UITouch *myTouch = ...
0
votes
2answers
2k views
How can I handle a touch event in cocos2d for Android?
How can I handle a touch event in cocos2d for Android? And how to move a sprite using ccTouchesMoved?
1
vote
1answer
507 views
Dynamic bodies with Parallax Scrolling
I have an object that has a dynamic body. Currently, I'm setting it's position to follow the sprite when the parallax layer move. After a certain event, the object suppose to fall to the ground. ...
1
vote
2answers
659 views
Cocos 2D putting things on the cocos thread or not?
We are using Cocos 2D for Android and are unsure if it's a good thing to execute our non-ui tasks on the Cocos thread as a way to get the animations in our game to pause.
What is the recommended ...
1
vote
2answers
790 views
Would a box2D sensor fit my needs?
I have a object in my game that when the main character hits it, all I want to do is have the object explode and then notify the character object that a hit has occurred.
Would I use a b2Body and ...
-1
votes
1answer
266 views
Insert object at index, when two objects collide
I have two arrays: one for projectiles, and one for targets.
Every target and every projectile has tag, and a tag with color (source code I took from Ray Wanderlich).
In my small game, when a ...
2
votes
1answer
580 views
Cocos2d+pybox2d vs Cocos2d-Iphone
Myself and two colleagues are working on making our first indie game for PC and, we decided to use Cocos2D + PyBox2D. We decided this based on what we've seen of Cocos2D-iPhone games, but I'm not ...
3
votes
1answer
926 views
Best way to prevent UIPanGestureRecognizer from firing when moving sprites in cocos2d
Im using UIPanGestureRecognizer in my cocos2d game to do drag and drop of sprites. I have a row of sprites and when I drag a sprite on top of another one, the sprite underneath it and any other ...
-2
votes
1answer
417 views
Did first generation Pokemon games use event driven input or poll based input?
Did the first generation Pokemon games for gameboy poll for the d-pad state or was the input state done based on events?
I'm currently trying to implement a similar control and I'm interested in ...
0
votes
1answer
642 views
Help implementing virtual d-pad
Short Version:
I am trying to move a player around on a tilemap, keeping it centered on its tile, while smoothly controlling it with SneakyInput virtual Joystick. My movement is jumpy and hard to ...
0
votes
2answers
221 views
Slow motion of a spherical object on an blunt slant obstacle
In cocos2d environment and box2D when an spherical object falls on a blunt slant obstacle, it moves really slowly, that's nauseating, if you have coded to not to have any interaction with world while ...
-1
votes
1answer
277 views
Is it any good to make play game in zoom condition?
I'm developing a game with large obstacle and sprites(in cocos2d+box2d for iPhone), then after zooming out my sprites and layer (by increasing cameraZ), I make my game to play by user, which causes ...
4
votes
1answer
1k views
Should I be subclassing CCSprites?
When I am working with cocos2d I can add CCSprites to the layer or 'stage' and manipulate them.
Now, to do my ongoing calculations for movement AI and such, things that will always run, should I:
...
2
votes
1answer
1k views
Programmatically set color of Box2D body's sprite or image
In my basic Cocos2D + Box2D iPhone app I have a bunch of circular Box2D bodies. I'd like to change the color of the circles programatically. What's the easiest way to do this?
So far I'm just ...
5
votes
2answers
962 views
top down game - checking, drawing enemy's line of sight area with obstacles
Examples of what i'm going to need:
I'm using cocos2d to draw a CCTMXTiledMap, on those tiles i'll have to draw the LOS cone.
How would i test if the player is within that cone, taking obstacles ...
0
votes
1answer
476 views
How do I open the camera in a CCScene node in a Cocos2D application?
I am new to Cocos2D and I can't find the way to open the camera from the library. I want to open the camera in the my game, can any one help me with with this?
Thank you in advance.
1
vote
1answer
1k views
Multiplayer game with Cocos2d-Javascript and Node.js
It is possible to make a multiplayer browser based game using cocos2d-javascript + node.js? If so, is there any tutorial about that?
2
votes
1answer
828 views
cocos2d: syncing CCAnimation frames with Box2d Shape manipulations
my cocos2d game currently has a ccsprite attached to a box2d body.
during the game i apply different CCAnimations on my sprite, i would like to perform certain manipulations to the box2d body ...
0
votes
1answer
746 views
Interacting with scene from controller/app delegate cocos2d
I'm attempting to make my first cocos2d (for iphone) multiplayer game and having difficulty understanding how to interact with a scene once it is running.
The game is a simple turn-based one and so I ...
4
votes
3answers
5k views
Tracking Multiple Touches using Hash codes in Cocos2d for iPhone
How do you implement a touch hash code and reference it later? I have read about a "hash" code, but I don't understand how to use it. I want to know when two of my Sprites are touched at the same ...
3
votes
1answer
1k views
How do you create your levels containing curved slopes in Box2d?
I have just started developing games for iPhone in Cocos2d and am currently working on a Box2D prototype. I know this is not an easy start, but I have experience in the AS3 port of the physics engine. ...
5
votes
2answers
1k views
cocos2d Merging box2d bodies
i'm using cocos2d to build an iphone game.
my game currently has two sprites: one for the main character and another for an item i should carry once he gets on him.
the main character and the item ...
5
votes
2answers
748 views
On cocos2d, what is better: one monolithic game cycle or many scheduled selectors?
I am building a simple tower defense game, and I have to take a decision between two(or more, feel free to suggest other ways) to do the game cycle.
Option 1: Monolithic game cycle:
I could have a ...
6
votes
4answers
3k views
Cocos2D collision detection against a random shape
I would like to brainstorm a few ways of handling how to detect a collision between a sprite and a user generated shape of some sort.
For example. There are 3 objects on the screen. The user takes ...
1
vote
2answers
368 views
Connect 4 Iphone game
I'm new to game development and development in general, I want to make a Connect 4 game. I have made a few simple game tutorials and I decided I wanted to make my own game now. I figured a connect 4 ...