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
3answers
4k views

How do I save data to the iPhone properly and securely?

I'm creating a game using Cocos2D (objective-c) and it has come to the point where I have to save data to local storage, like high scores and similar stuff. I know that NSUserDefaults is not a good ...
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 ...
2
votes
3answers
635 views

How do you maintain content size vs. content quality in a mobile application?

I am developing my first Cocos2d iPhone/iPad game that includes quite a few sprites, I would need approximately 80 different. As this is for both normal and HD displays I have 2x of each sprite. I am ...
1
vote
1answer
336 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
2answers
938 views

Cocos2d: Adding a CCSequence to a CCArray

I have a problem with an action performed by a sprite. I have one CCSequence in a CCArray and I have an scheduled method (is called every 5 seconds) that make the sprite run the action. The action is ...
1
vote
2answers
1k views

How do I repeatedly move an image by 1 pixel?

I have a method that is moving a UIImageView called shootImg across the screen: -(IBAction)shoot{ if (appDelegate.shootInt > 0) { if (direction == 1) { shootImg.center = ...
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 ...
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 ...
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 ...
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 ...
1
vote
3answers
2k views

Detecting End of Animation

So I am making a death animation for a game. enemy1 is a UIImageView, and what I'm doing is when an integer is less than or equal to zero, it calls this deathAnimation which only happens once. What I ...
-2
votes
3answers
985 views

Objective-C or javascript+html5+canvas? [closed]

I'm really interested in starting to study some language with the idea of develop games for ipad and iphone. My main concern is that as soon as is possible to develop games with javascrit and html5 ...
0
votes
1answer
353 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 ...
4
votes
2answers
314 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 ...
2
votes
1answer
529 views

How can I stop the next screen from briefly displaying at the start of a CCTransitionFadeTR?

I am testing transitions in cocos2d, and am running into a problem. I have a MainMenu screen which contains a button. The idea is that clicking on the button will trigger a CCTransitionFadeTR ...
3
votes
1answer
371 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?
4
votes
1answer
845 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 ...
-2
votes
1answer
2k views

To move the object (sprite) in all direction with constant speed in touch direction and to follow the touch path

I am developing this game in cocos2d. I want to move a object(airplane) in all direction with constant speed and it should move and flip in the direction of touch point and it should follow path make ...
-1
votes
1answer
231 views

CGPointMake in Respect to other UIImageViews

I have a UIImageView called hitBox, and another image called mainSprite. So what I want to do is when an IBAction is pressed, it will move hitBox to above mainSprite. I don't know if this is syntax ...
0
votes
1answer
876 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 ...
5
votes
2answers
811 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 ...
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 ...
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 ...
2
votes
3answers
718 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
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 ...
3
votes
3answers
9k 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 ...
1
vote
2answers
2k views

How to animate a flip of a card in Cocos2d?

I am working on a card game and would like to ask if someone could advice me how to implement a flip of a card in Cocos2D?
2
votes
1answer
2k 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 ...
0
votes
2answers
408 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 ...
2
votes
1answer
284 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 ...
3
votes
1answer
543 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 ...
1
vote
1answer
500 views

OpenGL ES Faces appear to be transparent when alpha is 1.0?

I am working on an object (OBJ File) loader for my app on iOS, currently I have successfully read the vertices and the faces of the object, and I am now just adding colours to the imported models. I ...
0
votes
1answer
379 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
450 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 ...
3
votes
1answer
583 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 ...
2
votes
2answers
1k 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 ...
2
votes
1answer
441 views

GNUstep Game Development

Are there any good resources out there for game development in GNU step? I looked at some of the source code for ooLite, but that didn't really have much in Objective-C. What is there these days?
3
votes
1answer
653 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 ...
-1
votes
1answer
675 views

Help: -[GameScene spiderBelowScreen]: unrecognized selector sent to instance 0x257f50

I am currently doing the tutorials in the book: "learn iPhone and iPad cocos2d Game Development" by Steffen Itterheim and have been running into problems with the code for the DoodleDrop tutorial, ...
1
vote
2answers
355 views

Are C and Objective-C sufficient for creating games on the iOS?

These days, I'm focusing on games development on the iOS. C++ is the lingua franca for games development but seriously, I prefer to code in C programming language, not in C++. So for iOS games ...
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 ...
1
vote
3answers
2k views

How to determine an irregular area of a CCSprite?

In my simple game I use boundingBox for pick coins and other stuff, but I need use irregular area detection of Sprite(with out Alpha)... There is alternative to boundingBox? Here is code: ...
1
vote
1answer
2k views

Count number of CCSprite added to a CCLayer

Does cocos2d has a method that returns the amount of CCSprites added to a CCLayer? A have SceneControlLayer object, and I added some CCSprites to it. @interface SceneControlLayer : CCLayer { } ...
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 ...
2
votes
6answers
995 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
998 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 ...
0
votes
2answers
2k views

OpenGL ES Framebuffer creation problem

I'm having some problems porting my D3D code to OpenGL ES. I have a Graphics Device class that encapsulates all rendering commands. The code below is in an ObjC++ file. The problem code is the called ...
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 ...
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 ...
6
votes
2answers
2k views

AI engine for iOS game development?

I'm looking for an AI engine for iOS game development (machine learning, path finding).