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
9 views

How to calculate positions and randoms in scene. SpriteKit

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
0answers
12 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
100 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
80 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
1answer
63 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
34 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
26 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', ...
-1
votes
0answers
47 views

Ray casting not checking in front of sprite

I posted this on stack overflow and didn't get many responses, maybe this exchange is better suited. I rotate my sprite to make sure its facing the direction its going like this in my update method: ...
0
votes
1answer
65 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
34 views

How can i stack up tiles for Connect4 objective C?

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
80 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
271 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
107 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
35 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
125 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
112 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
80 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
46 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
201 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
101 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
208 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
173 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
175 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
174 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
613 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
120 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
170 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
267 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
88 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
208 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
0answers
100 views

Objective C Collision Detection Problem

Ok, so I'm having a problem with setting up AABB Collision detection. I understand how to implement this and everything, and I know this method works, because, with few (functional) changes, I'm ...
0
votes
1answer
120 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
258 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
190 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
112 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
462 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 ...
0
votes
0answers
67 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 ...
3
votes
1answer
173 views

Rotate an image and get back to its original position - opengles glkit

I need to rotate an image in opengles GLkit and get it back to its original position in GLkit. rotation += 5; _modelViewMatrix = GLKMatrix4Rotate( _modelViewMatrix, GLKMathDegreesToRadians(5), 1, 0, ...
0
votes
1answer
226 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 ...
1
vote
1answer
198 views

opengles display human face in iphone and animate it?

I need to make a human 2D face to 3D face. I used this link to load an ".obj" file and map the textures. This example is only for cube and pyramid. I loaded a human face ".obj" file. This loads the ...
2
votes
2answers
228 views

How can I switch between scenarios in a text game?

I am making a text-based adventure game. How should I go about changing to another scene if the player wants to e.g. go to the house or walk down the road? I am using Objective C, but C will work ...
0
votes
1answer
409 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 ...
2
votes
0answers
131 views

Difference between multiple AudioUnits and one AudioGraph with a MultiChannelMixer

I'm porting my game to iOS using MonoTouch, and I'm having some trouble getting sound output to work. SystemSound/AVAudioPlayer is way too simple for my needs (I need looping and multiple simultaneous ...
0
votes
1answer
139 views

DPad style movement for AI without using A*

What is the easiest way to implement DPad style movement (No diagonal) for AI without using and A* algorithm? I thought about having the enemy catch up to the player in the Y axis first then the X ...
1
vote
0answers
103 views

iOS Facebook SDK, Games Start Playing post

im trying to implement a method in my native iOS game the publish a story on face book such as this photo most games that is integrated with facebook share stories like this in the activity section ...
2
votes
1answer
629 views

iOS game integrated with Facebook - Random game

How could I implement a random game for iOS via Facebook. I registered my game with Facebook and done everything so far... Can Facebook do such a thing? EDIT I connected my app to Facebook, I can ...
4
votes
1answer
1k views

How to make a iOS plugin for Unity3d

I've passed last 2 days reading articles and book for understand how can i make a plugin for iOS in Unity. Basically i need just a demo for understand how it work. For now i've tried to make this ...
3
votes
4answers
314 views

What is technical specs for iOS platform for a game?

I would like to know when a contractor ask you for a technical specs for iOS platform of a game, what's the description that you should give back to him?
1
vote
3answers
966 views

Wait till all CCActions have completed

I am developing a simple cocos2d game in which I want to animate two CCSprites simultaneously, and for this purpose I simply set CCActions on respective `CCSprite's as follows. [first ...
0
votes
1answer
169 views

Copies of GameScene created when called additional times

UPDATE: It no longer crashes after removing [self removeAllChildrenWithCleanup:YES]; from onExit. The artifacts still remain though. UPDATE 2: Found my problems. See my answer below. I have a game ...