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.
2
votes
3answers
77 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 ...
2
votes
0answers
37 views
What is Sprite Kit capable of? [closed]
I am messing around with Game Maker in my free time. I learned some Java at school but never really understood the object oriented principles. When I got to know Game Maker I was surprised that game ...
0
votes
0answers
5 views
SpriteKit Obj-C – How to add a force on a node a certain distance according to screen size
I have an SKSpriteNode that I'm trying to throw up to a certain point on the screen. I've tried applying an impulse and/or force according to the screen size, but that has strange results. I've also ...
2
votes
1answer
28 views
Objective-C SpriteKit – How to make a circle of buttons
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 to add to it. My buttons start from ...
0
votes
0answers
20 views
Drawing shapes within a rectangle area
I am working on a Objective-c project where I need to draw multiple rectangle shapes inside a rectangle area like the attached image. Basically calculating CGPoints inside the CGRect.
Thanks in ...
2
votes
0answers
24 views
Field of vision - Objective-c
Here's where I'm at.
Here's where I want to be
Here's how it's drawn
SKShapeNode *fov = [SKShapeNode node];
UIBezierPath *fovPath = [[UIBezierPath alloc] init];
[fovPath ...
3
votes
1answer
54 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 ...
1
vote
1answer
37 views
How to write a custom map canvas and project coordinates on it? [closed]
I am writing a game with Objective C ( xcode ) and I need to use the users location service to mark their position on a map but since I need to create my own map component, I am not able to use the ...
0
votes
1answer
56 views
How to resize the child node fit inside SKSpriteNode when resizing?
I am creating a virtual gamepad for my game, It has one main SKSpriteNode with circle image and four child node(up, down, left, right) with image. When I am using default size for all it looks perfect ...
0
votes
0answers
52 views
Moving pac-man in maze game using objective c
I am trying to develop maze game using objective-c, I want to allow moving the pac-man using swipe method, the user can swipe his fingers on the iPhone to indicate where he want PAC-MAN to go but I'm ...
1
vote
1answer
36 views
Run some objc code very early in unity iOS game lifetime
I want to hook up a crash reporting service to my unity iOS game. It's just one line of objC to add, as early into the app lifecycle as possible, but I'm not sure how to get it to run. I know I could ...
0
votes
1answer
99 views
Transition from UIView to CCScene in Cocos2D
I've surfed the internet for quite some time but haven't come to find an answer.
Any help would be greatly appreciated.
I am trying to perform a transition from a UIView to a CCScene
So i have a class ...
0
votes
0answers
25 views
Particles starting around specific shape?
I'm trying to solve a difficult UI issue with my iOS/Cocos2d game - I need a visual way of highlighting when a user has made a unique connection of the game pieces (think: a user a forms a triangle ...
1
vote
1answer
867 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?
...
6
votes
2answers
537 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.
GameObjects(model) <- Scene(controller) -> Sprites "SpriteKit" ...
1
vote
3answers
176 views
Finding neighboring coordinates on offset tile map
I have a grid of hexagonal tiles. Every other row is slightly offset for visual reasons. Imagine a player touches any tile - I need to compare the coordinate of that tile, with any tile they touch ...
1
vote
0answers
288 views
Making a card game [closed]
I'm making a card game, for mainly knowledge reasons. My tendency to learn so far has been to create and struggle through to have the knowledge at the end.
However, I've never made a game before. My ...
3
votes
3answers
471 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 ...
0
votes
0answers
70 views
iOS / Gamekit - Leaderboards empty after adding in 3 values from different accounts
I am trying to query for the high score and rank of a player on a leaderboard. I am using some code found on the Apple website:
- (void) retrieveTopTenScores
{
GKLeaderboard *leaderboardRequest = ...
0
votes
0answers
29 views
Reverting 2d canvas?
I'm making a multiplayer game which involves drawing lines. It's based this game: http://curvefever.com/sites/default/files/resize/remote/ef86488088c618df13b34f8b87aafd4e-1107x808.jpg. The game is ...
0
votes
1answer
71 views
memorizing button tap code iOS game
I'm using a single view app in Xcode 6.1 for my game with Storyboards. Not unity or sprite kit. It's a small game not even 3MB. Anyways, I created un-lockable characters with a BOOLEAN.
...
0
votes
0answers
174 views
Cocos2d v3 - addChild method make performance problems
i have currently a performance problem with the addChild method in cocos2d version 3.3. My scenario is currently that i have about ten CCNode which holds a bundle of other CCNode (about 500), i called ...
1
vote
0answers
37 views
CCActionMoveBy doesnot working properly when the action called for many of the sprite in cocos2d
I have an issue with CCActionMoveBy when I call the movement action for many of my sprites. I need to move to a certain position and then remove it from the scene.
My problem is If the call the ...
2
votes
1answer
122 views
How can I test if an oriented rectangle contains another oriented rectangle?
I have the following situation:
To detect whether is the red rectangle is inside orange area I use this function:
- (BOOL)isTile:(CGPoint)tile insideCustomAreaMin:(CGPoint)min max:(CGPoint)max {
...
0
votes
1answer
157 views
Scrolling effect after touch
i'm making map for a game and need to make scrolling of map, so the main thing what i need is to calculate speed and move layer after player remove finger from screen.
I make it my own, but i think ...
0
votes
1answer
167 views
Understanding CGPoints in SpriteKit
I am planning to place three cards on a view which I add to the background. However I wanted to combine two of the cards and replace the first card position with the new card position. Is there any ...
1
vote
1answer
369 views
How should I structure my code to add enemies?
So I am currently making a 1942-style game in Sprite Kit. I've reached the point where I am finished implementing pretty much everything (movement, shooting (also recognizing a hit and exploding an ...
0
votes
1answer
326 views
cocos2d + sneakyinput joystick multitouch problem
I've added a joystick to my iOS game using the latest SneakyInput joystick code for cocos2d v3. It works well, but when a CCButton I have is pressed, the joystick touch event ends.
Based on my ...
0
votes
0answers
69 views
CCTextField won't appear
I can't seem to add a CCTextField in my physics node, I tried all different methods, but it's still not happening.
Here's my code:
CCTextField *tf = [[CCTextField alloc] init];
tf.contentSize = ...
-2
votes
1answer
222 views
Error running an Action in Cocos2d-x
In my game I have a "rocket" type and I want to run a sequence of actions on it. At first it must run an explosion animation and then remove itself from the game. For this I used the following code, ...
1
vote
1answer
341 views
applyAngularVelocity causes error when called right after object instantiation
I'm trying to make a physicsBody rotate as soon as it is instantiated.
CCNode* ball = [CCBReader load:@"Ball"];
[ball.physicsBody applyForce:force];
[ball.physicsBody ...
1
vote
1answer
116 views
Manually remove inactive CCParticleSystem from scene?
When using particle systems that have a lifetime, with CCParticleSystem and its derived classes, should I manually remove the finished systems from their parent nodes once the particle animations are ...
0
votes
1answer
672 views
I need some help with stopping individual sound effects in OALSimpleAudio
I'm trying to find out how to stop a specific sound effect rather than having to stop all of them.
I'm using OALSimpleAudio.
I can't seem to find how to do it. simple google searches result in ...
1
vote
1answer
1k views
Spritebuilder and CCScrollView, page indicators not showing up?
I'm using Spritebuilder to make my game, and CCScrollView usually saves me quite a bit of time. I'm trying to implement the scroll view much in the same way as the home screen on an iphone uses the ...
5
votes
1answer
314 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 is the one I used for my games) . But ...
0
votes
1answer
295 views
Incorrect sprite rotation with atan2() [duplicate]
I want to rotate a sprite so that it faces the mouse cursor/screen touch location. Currently I'm using the following method to compute the angle of rotation. The input position is the target point the ...
1
vote
1answer
1k views
Preload in cocos2d v3
I'm trying to create a preload, but i don't know how to implement the code of this topic in cocos2d iphone v3. Since CCTextureCache has changed to CCTexture, and doesn't have sharedTextureCache ...
0
votes
2answers
71 views
Count number of CCNodes of a certain class on a layer
Pretty simple question. I'm working in Objective C (cocos2d) and I'm trying to count the number of a sprites of a certain class are present on the current layer being displayed. For example, I have a ...
0
votes
1answer
382 views
try to create CCSpriteFrame but get nil values
I'm trying to animate a CCSprite in cocos2d v3 following this question, but I'm getting the following error message in Log:
Terminating app due to uncaught exception 'NSInvalidArgumentException', ...
0
votes
1answer
129 views
Box2d stopping the movement of an object
I am in the process of making a game and I need an object to move only when the buttons are pressed. I have a method that begins the movement, and so far I am ending the movement of an object by ...
1
vote
0answers
116 views
How can i stack up tiles for Connect4 objective C? [closed]
I am trying to learn Objective C and iOS programming. And I'm trying to build a Connect Four. So Far i got this.
I've been looking around and asking around but I haven't got the answer to my ...
-4
votes
1answer
120 views
How can I develop a game for iOS? [closed]
I have a Mac arriving in the next few weeks, and plan to program a 2d game. I know a little bit of Java but nothing about Objective C. I've heard about cocos2d -- it seems good but I don't know ...
0
votes
1answer
630 views
Tower defense endless levels logic sprite kit [closed]
I am making a tower defense game for iOS using Sprite Kit. I would like for my game to support an endless number of levels, like in Bloons TD 5. What approach should I take to implement this?
0
votes
1answer
270 views
Help with concrete examples of Perlin Noise variables for terrain generation
I believe this question can help beginner game developers. I've looked through a dozen or so answers on perlin noise here and on Stackoverflow, and found only 1 concrete implementation of perlin noise ...
2
votes
0answers
38 views
How to implement a property with a base value and a changed value? [duplicate]
I have a number of stats and effects in game that are subject to change, they have some kind of base value and the current value. For stats, I implemented this in a dynamic way, but for less important ...
2
votes
2answers
167 views
Architecture - how to refer to skills/abilities internally within code?
I have about 60 skills within my game, which are loaded from a JSON file. Each skill is a subclass of a skill object and has attributes like range, cost, target type, etc. Currently each skill has an ...
1
vote
1answer
226 views
How to centralize stat/feat/equipment related changes in an RPG?
I have a game with an RPG system where derived stats, like HP,armor, etc depend on a variety of components: armor, stats and feats. I'm running into an issue where the code to change derived metrics ...
1
vote
1answer
132 views
Where can I find info on grid based algorithms for stateless AI? [closed]
There seems to be an overwhelming amount of info out there on AI of all kinds, and it's kind hard to digest at once.
For my testing purposes, I'm creating a "typical stateless AI", as described in ...
0
votes
1answer
103 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
1answer
513 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 ...