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

0
votes
0answers
25 views

Cocos2d v3 - addChild method make performance problems

i have currently a performance problem with the addChild method in cocos2d version 3.3. My scenario is currently that i have about ten CCNode which holds a bundle of other CCNode (about 500), i called ...
0
votes
0answers
20 views

CCActionMoveBy doesnot working properly when the action called for many of the sprite in cocos2d

I have an issue with CCActionMoveBy when I call the movement action for many of my sprites. I need to move to a certain position and then remove it from the scene. My problem is If the call the ...
0
votes
0answers
35 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 ...
1
vote
1answer
95 views

How can I test if an oriented rectangle contains another oriented rectangle?

I have the following situation: To detect whether is the red rectangle is inside orange area I use this function: - (BOOL)isTile:(CGPoint)tile insideCustomAreaMin:(CGPoint)min max:(CGPoint)max { ...
0
votes
1answer
57 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
64 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 ...
1
vote
1answer
189 views

How should I structure my code to add enemies?

So I am currently making a 1942-style game in Sprite Kit. I've reached the point where I am finished implementing pretty much everything (movement, shooting (also recognizing a hit and exploding an ...
0
votes
1answer
86 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
41 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
1answer
116 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
27 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
156 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 ...
1
vote
1answer
178 views

applyAngularVelocity causes error when called right after object instantiation

I'm trying to make a physicsBody rotate as soon as it is instantiated. CCNode* ball = [CCBReader load:@"Ball"]; [ball.physicsBody applyForce:force]; [ball.physicsBody ...
1
vote
1answer
80 views

Manually remove inactive CCParticleSystem from scene?

When using particle systems that have a lifetime, with CCParticleSystem and its derived classes, should I manually remove the finished systems from their parent nodes once the particle animations are ...
0
votes
1answer
303 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; } ...
1
vote
1answer
595 views

Spritebuilder and CCScrollView, page indicators not showing up?

I'm using Spritebuilder to make my game, and CCScrollView usually saves me quite a bit of time. I'm trying to implement the scroll view much in the same way as the home screen on an iphone uses the ...
5
votes
1answer
146 views

How can I implement Objective-C libraries in Unity?

I've been a "hardcore" developer for sometime now, as I've always worked with pure code reactive rendering, and contributed to Cocos2d library some time ago , (It is the one I used for my games) . But ...
0
votes
1answer
178 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 ...
1
vote
1answer
644 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
2answers
46 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
218 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
87 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 ...
1
vote
0answers
79 views

How can i stack up tiles for Connect4 objective C? [closed]

I am trying to learn Objective C and iOS programming. And I'm trying to build a Connect Four. So Far i got this. I've been looking around and asking around but I haven't got the answer to my ...
-4
votes
1answer
104 views

How can I develop a game for iOS? [closed]

I have a Mac arriving in the next few weeks, and plan to program a 2d game. I know a little bit of Java but nothing about Objective C. I've heard about cocos2d -- it seems good but I don't know ...
0
votes
1answer
487 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
183 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 ...
2
votes
0answers
37 views

How to implement a property with a base value and a changed value? [duplicate]

I have a number of stats and effects in game that are subject to change, they have some kind of base value and the current value. For stats, I implemented this in a dynamic way, but for less important ...
1
vote
2answers
141 views

Architecture - how to refer to skills/abilities internally within code?

I have about 60 skills within my game, which are loaded from a JSON file. Each skill is a subclass of a skill object and has attributes like range, cost, target type, etc. Currently each skill has an ...
1
vote
1answer
163 views

How to centralize stat/feat/equipment related changes in an RPG?

I have a game with an RPG system where derived stats, like HP,armor, etc depend on a variety of components: armor, stats and feats. I'm running into an issue where the code to change derived metrics ...
1
vote
1answer
105 views

Where can I find info on grid based algorithms for stateless AI? [closed]

There seems to be an overwhelming amount of info out there on AI of all kinds, and it's kind hard to digest at once. For my testing purposes, I'm creating a "typical stateless AI", as described in ...
0
votes
1answer
76 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
342 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 ...
1
vote
1answer
112 views

Designing a four-directional movement control

I'm developing an RPG for iOS. Currently, I plan my controls to look like this: So the user can interact with objects, people, etc. by tapping on the right side of the screen, and moves by swiping ...
0
votes
1answer
597 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 ...
2
votes
2answers
200 views

How do I make an equipped item affect the equipper?

I'm making a small text-based adventure in Objective-C. I have a Player class with four properties which represent the player's attributes (strength, agility, stamina, and intelligence). I also have a ...
1
vote
0answers
240 views

Image Texture Tracing Algorithm - Cocos2D Box2D

Context: I am working on a 2D Destructible Terrain engine for Cocos2D with Box2D. All images, when a level loads, have their border's traced and cached for the purposes of forming Box2D b2EdgeShape ...
5
votes
1answer
266 views

How can I implement a “Nyan Cat” rainbow?

I'm currently making a game similar to this Nyan Cat flash game, although I'm using cocos2d. I'm having a hard time trying to make the rainbow effect: Currently, every update call I add a piece of ...
1
vote
1answer
863 views

2D Destructible Terrain with Box2D / Cocos2D -> Image Tracing

Bear with me as this will be a rather lengthy post. For the last month I have been working on an open source Cocos2D, Box2D Destructible Terrain Engine. I have some questions regarding its ...
1
vote
1answer
152 views

Determining explosion radius damage - Circle to Rectangle 2D

One of the Cocos2D games I am working on has circular explosion effects. These explosion effects need to deal a percentage of their set maximum damage to all game characters (represented by ...
1
vote
0answers
325 views

Objective-C Moving UIView along a curved path

I'm not sure if I am approaching this the correct way. In my app, when a user touches the screen I capture the point and create an arc from a fixed point to that touch point. I then want to move a ...
1
vote
1answer
352 views

Mixing Objective-C and C++: Game Loop Parts

I'm trying to write all of my game in C++ except for drawing and game loop timing. Those parts are going to be in Objective-C for iOS. Right now, I have ViewController handling the update cycle, but ...
0
votes
2answers
219 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 ...
6
votes
1answer
255 views

Best way to determine surface normal for a group of pixels?

One of my current endeavors is creating a 2D destructible terrain engine for iOS Cocos2D (See https://github.com/crebstar/PWNDestructibleTerrain ). It is in an infant stages no doubt, but I have made ...
0
votes
1answer
142 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 ...
2
votes
1answer
279 views

Where to put common System functionality in Entity-System Design?

I am working on an Entity System design based largely off of Adam Martin's design and Ray Wenderlich's Objective-C Implementation. I am working on the AI system using a state machine with a System ...
3
votes
0answers
280 views

Gamepad support for OSX [closed]

What is the most common method for providing gamepad support in an OS X game? I've been using an IOHIDLIB wrapper named DDHIDLib https://github.com/Daij-Djan/DDHidLib and it seems to be working but I ...
0
votes
1answer
151 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 ...
5
votes
2answers
634 views

How to combine tap and long hold gesture recognizers?

I have a game in which the player moves around a sprite by tapping on various sections of the screen (left, right, up, down). So far, each tap moves the sprite one tile (I use a tile system for ...