Questions tagged [objective-c]
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.
180 questions
0
votes
1
answer
149
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
1
answer
705
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 ...
5
votes
1
answer
869
views
Bullet physics weird behavior. Jittering and drifting with btBoxShape
I'm dropping a simple box onto a plane from 100 units and my solution using Bullet Physics is giving me some weird behavior. The dimensions of the box are {2, 4, 1}.
When the box hits the ground it ...
1
vote
1
answer
221
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 in ...
0
votes
1
answer
2k
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 longer,...
2
votes
2
answers
378
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 (...
1
vote
0
answers
420
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
1
answer
805
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 ...
2
votes
1
answer
2k
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
1
answer
740
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
0
answers
1k
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
1
answer
673
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
2
answers
545
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
1
answer
849
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
1
answer
368
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 ...
3
votes
1
answer
394
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
0
answers
689
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
1
answer
213
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
2
answers
2k
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
0
answers
140
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
1
answer
852
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.
...
0
votes
1
answer
1k
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 ok ...
1
vote
1
answer
565
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
2
answers
581
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
1
answer
1k
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
0
answers
332
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 ...
0
votes
1
answer
231
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
1
answer
269
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 on ...
2
votes
1
answer
2k
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 ...
6
votes
1
answer
5k
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
4
answers
618
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
3
answers
3k
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 ...
0
votes
1
answer
298
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 ...
1
vote
0
answers
375
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
1
answer
138
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
1
answer
407
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
2
answers
740
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
1
answer
1k
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
1
answer
494
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
1
answer
906
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 ...
3
votes
1
answer
391
views
Wheel rotation, to change velocity of vehicle
I update the velocity of my vehicle like so:
...
5
votes
1
answer
599
views
UIView with IrrlichtScene [closed]
i have a UIViewController in a Storyboard and want to draw a IrrlichtScene in this View Controller.
My Code:
WWSViewController.h
...
0
votes
1
answer
505
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 mask, just ...
1
vote
6
answers
13k
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 ...
6
votes
1
answer
5k
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:
...
-1
votes
1
answer
5k
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
2
answers
503
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
1
answer
296
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
1
answer
2k
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
2
answers
444
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 ...