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
1answer
170 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 ...
1
vote
0answers
221 views

How do I use Objective-C libraries in Cocos2d-x?

We've created several libraries in Objective-C in the past, and now we're moving to the Cocos2d-x game engine. We can't figure out how to reference and use those libraries (we've also tried compiling ...
1
vote
1answer
74 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 ...
0
votes
1answer
175 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 ...
3
votes
2answers
367 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.
0
votes
1answer
432 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 ...
2
votes
1answer
208 views

Design leaderboard ratings for quiz games

Back in March 2011 i started the following post: How to design a leaderboard? Now my quiz game have been out for approximately a year and sold pretty decently. I am working on to update the game ...
0
votes
1answer
450 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 ...
2
votes
1answer
287 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 ...
1
vote
1answer
323 views

UIView with IrrlichtScene - iOS

i have a UIViewController in a Storyboard and want to draw a IrrlichtScene in this View Controller. My Code: WWSViewController.h #import <UIKit/UIKit.h> @interface WWSViewController : ...
0
votes
1answer
273 views

How can I simulate light using mask images on the iPad? [duplicate]

Possible Duplicate: Can I achieve a torchlight effect (lighter area around a light source) in a 2D game? I want to have a picture as a background, say this: Then I would like to apply a ...
1
vote
5answers
2k views

Snake game logic

So I'm thinking about making snake game. I started thinking about it. I figured out almost everything, but I have found one fundamental problem I can not fix myself and I need your help. The logic ...
5
votes
1answer
736 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... ...
-2
votes
1answer
1k views

How change the size of sprite in cocos2d?

I want to change the scale of sprite like a paper in 'Paper Toss' game. 'Paper Toss' is the game is available on the App store. I want to make a sprite like a paper and change the scale of sprite ...
-1
votes
2answers
396 views

Good open source iOS games? [closed]

I would like to see how things are done in modern iOS games, I am especially interested in Cocos2D games. I need a game that will compile (warnings are ok) and since most of the project I have seen ...
1
vote
1answer
204 views

Touch area double sized on newer device

I am developing a universal puzzle game, in which I have used separate image for iPhone4 and for iPhone3, iPhone4 image is double in size of iPhone3 image. My issue is for iPhone4, touch area of image ...
0
votes
1answer
542 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 ...
1
vote
2answers
292 views

How can I make a rectangle to an irregular shape?

I used masking for breaking an image into the below pattern. Now that it's broken into different pieces I need to make a rectangle of each piece. I need to drag the broken pieces and adjust to the ...
1
vote
0answers
242 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 ...
2
votes
1answer
460 views

Xcode workspace with Unity3D as a sub-project?

Let's say we're developing a 2D game with Cocos2d-iPhone and UIKit and CoreAnimation. But we're also considering leveraging the 3D capabilities of Unity 3D. Is it possible that we add the ...
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 ...
1
vote
1answer
462 views

Store and create game objects at positions along terrain

I have a circular character that rolls down terrain like that shown in the picture below. The terrain is created from an array holding 1000 points. The ground is drawn one screen width infront and ...
2
votes
1answer
764 views

How To show document directory save image in thumbnail in cocos2d class [closed]

I have just implemented multiple photo selection from iphone photo library and i am saving all selected photo in document directory every time as a array, now i want to show all saved images in my ...
0
votes
1answer
348 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, ...
1
vote
3answers
415 views

Missing z-axis rotation for transforming between two vectors

I'm trying to rotate a cube so that it's facing up, but am getting hung up on the final implementation details. It now reliably will rotate the x,y axis to the correct side, but the z-axis is never ...
2
votes
2answers
741 views

Issue with removing sprites on collision

I'm trying to make a very simple collision detection procedure just for test purposes. The problem is with the send/receive information between functions I have these lines on the update method ...
0
votes
1answer
209 views

Changing location after CommitAnimations

I'm using the following code to move a UIImageView: shootImg.image = [UIImage imageNamed:@"Projectile Left 1.png"]; [UIView beginAnimations:nil context:nil]; shootImg.center = ...
2
votes
1answer
739 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); ...
0
votes
1answer
134 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 ...
2
votes
1answer
157 views

How can I implement temporary effects in Objective-C?

How could I use this IBAction -(IBAction)shield:(id)sender{ appDelegate.healthInt = 150; } and simply make it work for a limited time. I want to set appDelegate.healthint = 150 for about 20 ...
0
votes
0answers
177 views

Schedule update problem

This might sound pretty straightforward. I've created a method and I've called it as below in the init method. [self createNewSpr:ccp(s.width * 0.25,s.height-200)]; [self createNewSpr:ccp(s.width * ...
1
vote
0answers
228 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 ...
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 ...
1
vote
0answers
127 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 ...
0
votes
1answer
466 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 ...
1
vote
0answers
308 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
5answers
2k views

Learning C++ but wanting to develop iOS Apps

I'm a computer engineering student and taking my second programming class. I'm learning C++ using "C++ Primer Plus" 5th edition by Prata. I want to develop for iOS. I understand the main language for ...
3
votes
3answers
552 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 ...
6
votes
3answers
2k 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 ...
1
vote
3answers
3k 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
594 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
304 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
824 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
814 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 ...
2
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
1k 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 ...