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

16
votes
5answers
3k views

Can I develop games for mobile platforms in C++?

I have a good grasp in C++ and C and have also experience developing AAA game using C++. Now, I'm shamelessly thinking to dive into mobile game development either in iOS or Android. Unfortunately, I ...
15
votes
5answers
18k views

Objective-C or C++ for iOS games?

I'm pretty confident programming in Objective-C and C++, but I find Objective-C to be somewhat easier to use and more flexible and dynamic in nature. What would be the pros and cons when using C++ ...
13
votes
5answers
4k views

Tools for generating texture atlases/sprites from source images? [closed]

Is there an industry standard file format for texture atlases? What are the apps that take a directory of images and turns it into a texture atlas png and a text file describing what's on it? This ...
9
votes
6answers
2k views

Storing game state at exit on the iPhone with Objective-C

How would you store your game state at exit for an iPhone game written in Objective-C?
9
votes
6answers
4k views

Very simple open source games in various languages?

Are there any very simple open source games available just to demonstrate the basics of the programming techniques? Preferably something which fits in to a couple hundred lines of actual code. ...
8
votes
4answers
4k 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 ...
6
votes
2answers
1k views

Sending a struct containing a string over network

I'm trying to send structs as neatly sorted packets using iPhone Game Kit.. I have a struct which looks like: typedef struct { int coolStuff; char playerID[100]; } MyStruct; Then I'm using ...
6
votes
3answers
3k views

How to achieve uniform speed of movement on a bezier curve?

I'm trying to move an image along Bezier curve. This is how I do it: - (void)startFly { [self runAction:[CCSequence actions: [CCBezierBy actionWithDuration:timeFlying bezier:[self ...
6
votes
3answers
1k 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 ...
6
votes
2answers
1k views

AI engine for iOS game development?

I'm looking for an AI engine for iOS game development (machine learning, path finding).
6
votes
1answer
237 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 ...
5
votes
1answer
2k views

Creating an isometric map with hexagonal tiles for iPad

I'm new to game development, so I need a little help. I have to write down a little game which has a floor with hexagonal tiles but it must be seen in a isometric view like The Sims. Ignoring the ...
5
votes
2answers
778 views

Best way to do buttons for an OpenGL ES iPhone game

I'm making a simple 2d game in OpenGL ES and I want to add movement buttons to it. What's the best way of going about this? In previous projects I've simply added UIButtons to the view but I hear ...
5
votes
1answer
131 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 ...
5
votes
1answer
237 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 ...
5
votes
2answers
567 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 ...
5
votes
1answer
900 views

OpenGL blending (masking)

I need some help with OpenGL textures masking. I have it working but need to find some other blending function parameters to work in other way. Now I have: //Background ...code... ...
4
votes
5answers
2k views

Is it worth planning to be cross-platform in mobile game development?

Disclaimer: my goal is not to use cross-platform frameworks like Unity. I am currently planning a mobile game which I intend to first launch on iOS. However, I am wondering if it is better to write ...
4
votes
4answers
12k views

Do you know any 3D engines written in Objective-C for iOS?

In the next few weeks I will start a game for iOS, most of the action will happen in 2D but a 2D engine is not enough for our idea, therefore I'm doing a small research on available 3D engines for iOS ...
4
votes
1answer
1k views

How do I break an image into 6 or 8 pieces of different shapes?

I am working on puzzle game, where the player can select an image from iPhone photo gallery. The selected image will save in puzzle page and after 3 second wait the selected image will be broken into ...
4
votes
1answer
2k 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 ...
4
votes
1answer
837 views

Cocos2D-iPhone, how does the Game Loop work in Cocos2D?

Could anyone theoretically explain how the game loop works in Cocos2D and Objective-C? If you need me to be more specific about what I'm asking, please read on. I've got a rudimentary understanding ...
4
votes
3answers
2k views

What resources are available for Mac OS game development?

Are there are any modern resources on how to develop games for Mac OS? I suppose this would include objective c, cocoa and opengl 3+. The book Beginning Mac OS X Game Development with Cocoa looks ...
4
votes
2answers
312 views

Aggro with Images

I have three UIImageViews. enemy1, enemy1AggroBox and mainSprite. What I want to do is when mainSprite and enemy1AggroBox interect, I want enemy1 to start moving towards mainSprite. Basically ...
4
votes
2answers
811 views

How to design a leaderboard?

This sounds like an easy thing but when I considering the following Many players Some have played many games and some just started Different type of statistics On what information should the ...
3
votes
3answers
8k views

Can Xcode be used to create very simple games?

I am brand new to Xcode, and I am also brand new Objective-C programmer. I was wondering if it is possible to create simple Mac games with Xcode. If it's not possible, could you recommend me some ...
3
votes
2answers
3k views

How to implement “Flick” gesture for throwing an object in the 2D realm

I am trying to implement a FLICK gesture for throwing a ball from point A to point B on the iPhone. This is my current plan.... Using touchesBegan and touchesEnd I can find the direction I need to ...
3
votes
3answers
637 views

What algorithm can I use to detect simple shapes in a 4x4 matrix?

I'm working on a simple multiplayer game that receives a random 4x4 matrix from a server and extracts a shape from it. For example: XXOO OXOO XXOX XXOO XOOX and XOOO XXXX OXXX ...
3
votes
3answers
1k views

How do I find the angle required to point to another object?

I am making an air combat game, where you can fly a ship in a 3D space. There is an opponent that flies around as well. When the opponent is not on screen, I want to display an arrow pointing in the ...
3
votes
2answers
424 views

Separating UI and logic in Objective-C at iOS based Games

How to separate UI and logic in Objective-C based mobile games? To develop games, I use Cocos2d library. I need a good reference to separate my UI code from game logic code.
3
votes
1answer
632 views

iOS custom memory allocator

I'm about to start writing an iOS game and I'm going to use mainly C++/C for the core gameplay logic. I really like pre-allocating everything in the game and try to avoid any dynamic allocations as ...
3
votes
4answers
343 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?
3
votes
1answer
361 views

Cocos2d — Check if place is free before moving (all objects)

Is there a method in Cocos2d like CGRectIntersectsRect, except instead of limiting it to one sprite, it checks for ALL objects?
3
votes
1answer
563 views

How can I spawn monsters at random locations?

I made a little 2D shooter game for my iPhone. I want monsters to spawn at random locations. But I don't have any clue where to start to make them spawn. I already made the monster image and ...
3
votes
1answer
219 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, ...
3
votes
1answer
1k views

Best Method to Create Side Scrolling Levels? - Cocos2D

I am looking to start my first side scroller project using Cocos2D, but I am curious. What is the preferred/best method of creating you levels? For large levels I see hand making it very laborious, is ...
3
votes
1answer
786 views

How to use Irrlicht with Objective-C?

Irrlicht uses namespaces, a C++ feature not available in Objective-C: /* In the Irrlicht Engine, everything can be found in the namespace 'irr'. So if you want to use a class of the engine, you have ...
3
votes
0answers
238 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 ...
3
votes
1answer
528 views

Unusual Lighting Effects - Random Polygons Coloured

I am working on creating an object loader for use with iOS, I have managed to load the vertices, normals and face data from and OBJ file, and then place this data into arrays for reconstructing the ...
2
votes
4answers
990 views

Objective C and C++ for Game Development

I'm trying to figure out which language I should begin learning. I've only been programming for about 6 months, with languages like PHP, Java, and C#. I want to learn how to dev games, and while I ...
2
votes
2answers
290 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 ...
2
votes
6answers
970 views

Random Position between ranges

Does anyone have a good algorithm for generating a random y position for spawning a block, which takes into account a minimum and maximum height, allowing player to to jump on the block. Blocks will ...
2
votes
4answers
1k views

Objective-C to plain c iPhone game performance improvements

I'm testing a 2D OpenGL ES based iPhone game on both the iPhone 3G and the iPhone 4. It runs great on the iPhone 4... and pretty well on the 3G. The game state is updated at 60 Hz... and the ...
2
votes
1answer
769 views

Drawing multiple Textures as tilemap

I am trying to draw a 2d game map and the objects on the map in a single pass. Here is my OpenGL initialization code // Turn off unnecessary operations glDisable(GL_DEPTH_TEST); ...
2
votes
1answer
283 views

What is wrong with my technique for transmitting server and client game state?

I'm doing a network implementation of a fast-paced game. I have a puck on bot the server and client side of the simulation. I want to update the client puck position only if they are on the same ...
2
votes
3answers
712 views

Objective-C or C++ of game engine header file for iOS developers?

We've developed a game engine written in C++. Now we are preparing our game engine for iOS developers. I guess that many game developers use C++ or Objective-C for their game apps. So I think we ...
2
votes
2answers
191 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 ...
2
votes
1answer
888 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 ...
2
votes
1answer
314 views

Wheel rotation, to change velocity of vehicle

I update the velocity of my vehicle like so: [v setVelocity: ((2 * 3.14 * 100 * (wheel.getRotationValue / 360) / 30)) * gameSpeed]; // update on 60 fps this gets velocity on all frames divide by 60 ...
2
votes
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 ...