Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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.

Filter by
Sorted by
Tagged with
22
votes
4answers
13k 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: ...
18
votes
5answers
22k 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++ ...
16
votes
6answers
6k 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 ...
13
votes
5answers
5k 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 ...
11
votes
2answers
2k views

Does SpriteKit follow the MVC pattern?

I am currently working on an iOS project called Old Frank that I have been trying to follow a MVC design pattern. The gist of it is. ...
10
votes
4answers
4k views

In Cocos2D, how do I check for collisions against an arbitrary user-drawn shape?

I want 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 their finger and draws an abnormal shape around 2 ...
10
votes
6answers
3k 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?
7
votes
7answers
6k views

Very simple open source games in various languages? [closed]

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. ...
6
votes
2answers
2k 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: ...
6
votes
1answer
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 ...
6
votes
2answers
1k 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 ...
6
votes
2answers
3k 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 an isometric view like The Sims. Ignoring the ...
6
votes
4answers
3k 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
1answer
633 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 ...
6
votes
1answer
2k views

AI engine for iOS game development? [closed]

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

How to play sound effects on iOS?

I have a game that plays sounds when some events occur. Currently, I am using AVAudioPlayer for the purpose of playing the sound. But just the bare ...
5
votes
1answer
731 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 ...
5
votes
1answer
3k 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: ...
5
votes
1answer
539 views

UIView with IrrlichtScene

i have a UIViewController in a Storyboard and want to draw a IrrlichtScene in this View Controller. My Code: WWSViewController.h ...
4
votes
3answers
13k 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 ...
4
votes
2answers
5k 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 ...
4
votes
3answers
3k 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 ...
4
votes
6answers
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
1answer
3k views

Spritekit water flowing [closed]

I'm wondering if there is a way in spritekit to implement water flowing through a path? like this water flow Right now I'm generating the path using UIBezierPath and PaintCode Any suggestion? ...
4
votes
1answer
2k 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
963 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
4answers
14k views

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

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
4answers
527 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?
4
votes
1answer
1k 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 ...
4
votes
1answer
2k 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 ...
4
votes
2answers
318 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
1k 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 actual ...
3
votes
3answers
1k views

How to approach 360 degree snake without having it “slide”

There's a great question here that helps me a little bit in what I want to do, and it explains it quite well: How To Approach 360 Degree Snake Basically, I want to have a smooth 360-degrees Snake ...
3
votes
1answer
919 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 ...
3
votes
3answers
1k 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: ...
3
votes
2answers
680 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
888 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
3answers
2k views

How to set up a game loop for a project targeting iOS?

I'm a fellow game programmer who's done many game engines in Game Maker 8.1, Visual Studio XNA and MonoGame with C#, and one in Java Android with Eclipse. I'm very used to C# and love it plus the VS ...
3
votes
1answer
358 views

Wheel rotation, to change velocity of vehicle

I update the velocity of my vehicle like so: ...
3
votes
1answer
461 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
330 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
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 ...
3
votes
1answer
258 views

How to calculate final force vector for the SKSpriteNode

I am creating space game which has an effect similar to black hole's gravitational effect. Wherever the spaceship is going, the black hole will attract it, summing up all the vectors together. I know ...
3
votes
1answer
701 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. ...
3
votes
1answer
2k 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 ...
3
votes
1answer
847 views

How to use Irrlicht with Objective-C?

Irrlicht uses namespaces, a C++ feature not available in Objective-C: ...
3
votes
1answer
357 views

Objective-C SpriteKit – How to make a circle of buttons [closed]

I have some code in a project already, but I'd like to change it up a bit. Currently, my code creates an empty node called _buttonLayer and then create some buttons ...