Tagged Questions

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

3
votes
1answer
238 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
398 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
238 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
317 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
555 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
159 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
176 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
1answer
131 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
950 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
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 ...
3
votes
4answers
364 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
2k 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
212 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
260 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
79 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
215 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
440 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
696 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
260 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
523 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
318 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
358 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
327 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
6answers
3k 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
970 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... ...
-1
votes
1answer
2k 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
415 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
214 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
838 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
301 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
251 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
584 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
491 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
1k 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
377 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
472 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
1k 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 ...
1
vote
1answer
243 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
777 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
142 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
162 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 ...
1
vote
0answers
277 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
134 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
564 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
376 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
656 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 ...
7
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 ...