Objective-C is a general-purpose, high-level, object-oriented programming language. It's mainly used for game development on Apple iOS and Mac OS devices, however it's not limitied to this platforms.

learn more… | top users | synonyms

1
vote
1answer
78 views

Data model for unlockable card collection

My game has a collection of cards (about 64) that are unlocked (one by one) provided that 4 items are collected/gained in the game. Right now the deck of cards is modeled with a plist file, like ...
1
vote
0answers
249 views

Design pattern for procedural terrain assets

I'm developing a procedural terrain class at the moment and am stuck on the correct design pattern. The terrain is 2D and is constructed from a series of (x,y) points. I currently have a method that ...
1
vote
0answers
273 views

Cocos2D and iPhone's accelerometer

good afternoon! Today I've started to develop a game and I got a trouble. So, first at all I would like to say that I have no experience developing games... So, I've a CCSprite in the layer and I ...
1
vote
0answers
134 views

Game Development Resources? [closed]

I want to make an iPhone game and I was wondering if somebody could point me to some resources. Before you rage and close this, I am not looking for just a tutorial on programming, I could just google ...
1
vote
0answers
364 views

Zoom Layer centered on a Sprite

I am in process of developing a small game where a space-ship travels through a layer (doh!), in some situations the spaceship comes close to an enemy space ship, and the whole layer is zoomed in on ...
1
vote
1answer
333 views

Objective - Gestures while finger touches screen

I'm creating a space cocos2d game with objetive-c. I have in the bottom left 2 arrows to move the sprite left or right. I also implemented a swipe gesture to change weapon, however it only happens ...
1
vote
1answer
3k views

Cocos2d CCSpriteFrameCache: couldn't load texture file

I am currently doing this Cocos2d tutorial: http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d ...and get the following error messages: 2011-12-30 16:36:28.536 ...
1
vote
1answer
1k views

How to make the accelerometer work in different angles

I am working on some Cocos2D tutorials (doodle drop) and have downloaded the program on my device. The program is working but I have to hold the iPhone in a very specific, and not very good, angle to ...
1
vote
4answers
414 views

How do I randomly create and store enemy data for my iPhone game?

In my game you need to protect something from enemies. There can be many on the screen at once. But I don't know how to create the enemies randomly, and how I can save the data to each enemy? Can give ...
0
votes
1answer
207 views

Long running calculation on background thread

In my Cocos2D game for iOS I have a relatively long running calculation that happens at a fairly regular interval (every 1-2 seconds). I'd like to run the calculation on a background thread so the ...
0
votes
1answer
149 views

Incorrect sprite rotation with atan2() [duplicate]

I want to rotate a sprite so that it faces the mouse cursor/screen touch location. Currently I'm using the following method to compute the angle of rotation. The input position is the target point the ...
0
votes
2answers
45 views

Count number of CCNodes of a certain class on a layer

Pretty simple question. I'm working in Objective C (cocos2d) and I'm trying to count the number of a sprites of a certain class are present on the current layer being displayed. For example, I have a ...
0
votes
1answer
169 views

Help with concrete examples of Perlin Noise variables for terrain generation

I believe this question can help beginner game developers. I've looked through a dozen or so answers on perlin noise here and on Stackoverflow, and found only 1 concrete implementation of perlin noise ...
0
votes
1answer
497 views

Cocos2d how to correctly preload a spritesheet before the scene start?

I'm working on a game with Objective-C and Cocos2d, the game has a huge number of images, and obviously as I add images on the spritesheet (well yes I'm using spritesheets) the loading time get ...
0
votes
1answer
371 views

Quit the application when clicking cancel button of Alert View in C#

Can someone guide me as to how can I make an application quit when you press the cancel button of an Alert View in C# code? Thanks I forgot to add that I am trying to quit application on clicking ...
0
votes
1answer
374 views

Triangles in a C++ STL Vector as an Objective-C member sometimes draws incorrectly in OpenGL ES

The polygons draw correctly 80% of the time. When it fails, a vertex is dislocated. The polygon is consistently drawn with the wrong vertex. I checked that the vector is correct during initialization, ...
0
votes
1answer
141 views

CCSprite x and y comparison

I have 2 CCSprites and I want to tell if their x and y are equal I tried this: if(sam.position.x == tom.position.x && sam.position.y == tom.position.y){ NSLog(@"Hooray!"); } Although I do ...
0
votes
1answer
1k views

b2Body moves without stopping

I got a quite strange bug. It is difficult to explain it in two words, but i'll try to do this in short. My b2Body has restitution, friction, density, mass and collision group. I'm controlling my ...
0
votes
1answer
865 views

Cocos2d: how to add anchor points to CCSpriteBatchNode

I am doing some tests with animations in Cocos2D using sprite-sheets. The animation works ok except that the anchor-point is in the center. I need to put it in the bottom. With the code below i am not ...
0
votes
2answers
395 views

What is the most secure way to archive a GKScore to be re-submitted later?

I'm looking for the safest way to archive and store a GKScore that needs to be re-submitted to Game Center (say, because the user didn't have a network connection at the time the score was earned). I ...
0
votes
1answer
503 views

Preload in cocos2d v3

I'm trying to create a preload, but i don't know how to implement the code of this topic in cocos2d iphone v3. Since CCTextureCache has changed to CCTexture, and doesn't have sharedTextureCache ...
0
votes
1answer
170 views

try to create CCSpriteFrame but get nil values

I'm trying to animate a CCSprite in cocos2d v3 following this question, but I'm getting the following error message in Log: Terminating app due to uncaught exception 'NSInvalidArgumentException', ...
0
votes
1answer
449 views

Tower defense endless levels logic sprite kit [closed]

I am making a tower defense game for iOS using Sprite Kit. I would like for my game to support an endless number of levels, like in Bloons TD 5. What approach should I take to implement this?
0
votes
1answer
71 views

Create body on a sprite (box2D)

I'm quite experimented in objective C, but now i'm tried cocos2D and his features. I need to add a body on a spritesheet (if possible on a classic 'UIImageView'), in order to detect collisions after. ...
0
votes
1answer
136 views

How to store NPC movement data?

In my 2D tile-based game, I have NPCs that move around on a fixed path. I am putting the information about the NPCs in a .plist file that is loaded on startup. The thing is, I'm not sure how to format ...
0
votes
1answer
535 views

Using depth buffer on a sprite

I am following this guide: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps Trying to create a tiled map that also supports multiple layers. The guide says that a way is to use ...
0
votes
1answer
668 views

Admob banner not getting remove from superview

I am developing one 2d game using cocos2d framework, in this game i am using admob for advertising, in some classes not in all classes but admob banner is visible in every class and after some time ...
0
votes
1answer
520 views

OpenGLES how to make a 3D object iOS

I am a newbie in OpenGLES, so pardon me if I cannot state the question properly. Is it possible to create a 3D box with the following imports only: OpenGLES, QuartzCore, GLKit I have created a 2D ...
0
votes
1answer
799 views

Level selection view - similiar to Angry Bird's

I am making game and need to prepare view for level selection. Could you recommend me some opensource library which could I use? I need icons to vibrate after long pressing one of them, some callbacks ...
0
votes
1answer
2k views

How to simulate a water splash effect?

I need to achieve the effect of a ball falling down into a pool then splashing in the water. At first, I made a sensor to detect the collision between the ball and the water and then show the sprite ...
0
votes
1answer
548 views

Thread-safety in Cocos2d-iPhone?

After tinkering a bit with cocos2d, I discovered that there is no classic game loop and everything is more-or-less event driven. I guess I can wrap my head around that, no problem. But I cannot find ...
0
votes
1answer
352 views

Keep running CGRectIntersect Method - Objective C

I have two UIImageViews. mainSprite, and enemy1. And I have a method that makes enemy1 start moving towards mainSprite. So here's that method. -(void)enemy1Aggro{ if ...
0
votes
1answer
378 views

objective-c iphone sdk side scrolling

I was making a game and I did the side scrolling like this: if the player get past 150, the player stops moving and the background starts moving. But thats very annoying with placing objects in the ...
0
votes
3answers
447 views

How can I spawn multiple monsters in my game?

I made a little iPhone game in which I want to make multiple monsters spawn. I have one UIImageView called enemy that spawns at beginning of the game. But I want it to spawn many more monsters until ...
0
votes
0answers
10 views

Cocos2D v3 CCParallaxNode scrolling can't keep player in focus

I am very fresher to game development and I need to develop a game like NinjaJump. I have created a CCParallaxNode to setup scrolling background and added CCPhysicsNode to setup Physics world. I have ...
0
votes
1answer
37 views

Scrolling effect after touch

i'm making map for a game and need to make scrolling of map, so the main thing what i need is to calculate speed and move layer after player remove finger from screen. I make it my own, but i think ...
0
votes
0answers
49 views

sprite kit xcode CGPoint

Hi I am a newbie in this sprite kit xcode. So I am planning to place three cards on the view which I add them to the background. However I wanted to combine two of the cards and replace the first ...
0
votes
1answer
64 views

cocos2d + sneakyinput joystick multitouch problem

I've added a joystick to my iOS game using the latest SneakyInput joystick code for cocos2d v3. It works well, but when a CCButton I have is pressed, the joystick touch event ends. Based on my ...
0
votes
0answers
34 views

CCTextField won't appear

I can't seem to add a CCTextField in my physics node, I tried all different methods, but it's still not happening. Here's my code: CCTextField *tf = [[CCTextField alloc] init]; tf.contentSize = ...
0
votes
0answers
78 views

Error running an Action in Cocos2d-x

In my game I have a "rocket" type and I want to run a sequence of actions on it. At first it must run an explosion animation and then remove itself from the game. For this I used the following code, ...
0
votes
0answers
23 views

How can i get latency when using Game Center?

I'm pretty new to network programming. Basically I'm using game center for making a relatively simple iPhone game using Game-center p2p. However i'm now working on a algorithm to improve the ...
0
votes
0answers
25 views

How can I fix latency problems for car game? [duplicate]

Basically I'm trying to make a online car racing game for IOS using Game Center real time multiplayer. I have setup a timer that sends data every 0.02 seconds to the other player with the current ...
0
votes
0answers
116 views

Cocos2dx InApp Purchase for ios

I am trying to integrate In App Purchases in my app made by using cocos2d x c++. I am using easyNdk Helper for In App Purchases. My In App Purchases works perfectly for my Objective C apps. But for ...
0
votes
1answer
215 views

I need some help with stopping individual sound effects in OALSimpleAudio

I'm trying to find out how to stop a specific sound effect rather than having to stop all of them. I'm using OALSimpleAudio. I can't seem to find how to do it. simple google searches result in ...
0
votes
0answers
32 views

How to calculate positions and randoms in scene. SpriteKit [duplicate]

So here is a code : static inline CGFloat randomInRange(CGFloat low, CGFloat high) { CGFloat value = arc4random_uniform(UINT32_MAX) / (CGFloat)UINT32_MAX; return value * (high - low) +low; } ...
0
votes
1answer
85 views

Box2d stopping the movement of an object

I am in the process of making a game and I need an object to move only when the buttons are pressed. I have a method that begins the movement, and so far I am ending the movement of an object by ...
0
votes
1answer
304 views

cocos2d collision detection between two ccsprites i am using boundingBox but this method is not working [closed]

I am making a cocos2d side scroller and I am currently putting collision detection in. I have an enemy that shoots at the player. I want to have the bullets disappear when they hit the player. The ...
0
votes
2answers
186 views

Cocos2d sprite's parent not reflecting true scale value

I am encountering issues with determining a CCSprite's parent node's scale value. In my game I have a class that extends CCLayer and scales itself based on game triggers. Certain child sprites of ...
0
votes
1answer
149 views

Set texture of a LHSprite that is loaded from LevelHelper

How do i set the image/texture of an LHSprite that is loaded into xCode using levelHelper & spriteHelper? I am using sprite sheets. So i tried to load the image the old fashioned way using ...
0
votes
0answers
84 views

Make a layer over an image and adjust its co-ordinates by touch

I need to make a layer over an image and adjust the layer to fit to image and get its co-ordinates of the layer. I need to adjust the layer by touch and pinch. The sample image is as below. I need ...