8

This is a very interesting topic. You can build the water effect using SpriteKit and its integrated physics engine. Step 1 Create a Physics World Create many little circular SKSpriteNode(s), each one will have a circular physics body matching the graphics representation Step 2 Then every frame you'll need to: Draw all the sprites on a buffer Apply a ...


5

Your question is a good one. I've had exactly the same question regarding SpriteKit and have been very confused about the lack of information on the web about this. SpriteKit seems to encourage you to put all of your Model-View-Controller code into the same class (your SKScene subclass), which is really confusing to me. How would you ever build a game of ...


5

Plugins for Unity can be written using Objective C; refer to this page: http://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html However I wouldn't assume that a code library of thousands of lines that wasn't designed to be used as a Unity plugin will work as a Unity plugin. It's all free so you could download Unity, fire up the demo project, and ...


4

One method is to have the head define a trail as it moves and position all other nodes at positions along this trail. In this method you need to define the position of the body parts as a constant distance along the snake from the head. So on each frame you want to; update the position of the head. add the current position of the head to a list of ...


3

If I understood you correctly, you only want to know whether two tiles, specified by their 2D offset coordinates, are adjacent or not. For any question related to hexagon grids, I'd recommend to refer to the Hexagonal Grids page by Amit Patel. It contains the mathematical backgrounds as well as excellent animated interactive examples, and probably ...


2

As mentioned in the answer you reference, this is sort of the artistic side of procedural generation. These are the kind of functions you just have to keep tweaking until you get something that works for you. Everyone is going to have different ways of generating terrain and even a number of different ways to generate noise. It's unlikely there's going to ...


2

One alternative that avoids lengthy switch statements all over the program would be to define inside your Skill interface additional components that define its behavior. These components would be implementing an interface as well. For example, all skills might contain an attack behavior, which could look like: IAttackBehavior attackBehavior; Creating an ...


2

General advice is to start with the switch statement. At some point you may notice that you're writing a lot of very similar code in different 'case' blocks within the switch statement. If and when you notice that, that's the time to refactor the code so that those similar cases can be coalesced into a single block. Until then, go with the switch ...


2

Do as ryrich said, however the actual code on Objective-C would be something like this: (Assuming your CCNode class is called "Seal") int sealCounter = 0; for (id *node in self.children) { if ([node isKindOfClass:[Seal class]]) { sealCounter++; } }


2

Let's speak radians. Your angle is clamped to a real range and from what I can see from your video I would say between −π/2 and 3π/2. Now you can also view angles in different ways, for example as points on a circle. This is clearly the intuitive way to see your problem : in your case the tip of your ship is the considered “angle point” on the circle. ...


2

If the only difference between the enemies are sprite changes and simple quantities (number of shots fired, rate of fire, etc), multiple classes would not be needed. This is exactly the sort of game Sprite-Kit was designed to make easily and quickly. Classes would be more appropriate if there was some unique behavior between the different kinds of enemy ...


2

I've implemented the kind of smooth snake movement that you explain. It's actually quite simple, but most of the examples I found while looking were the same kind as you encountered. And I don't think it's as easy to explain in plan words. As you can see, my snake is a bit unusual, thats why providing implementation here is not really optimal. But I think ...


2

First you need to know what is an ellipsoid and why we use them. The earth is spherical and to be exact it can be approximated using an ellipsoid. Location Service and all GPS system that work world wide, must use an ellipsoid that fits the best way the earth, Why we need an ellipsoid? because we need a mathematical model to do the computations. for ...


2

For a 2D puzzle game for iPhone and iPad, SpriteKit would be the easiest way to do this. SpriteKit is made especially for developing 2D games. You don't have to bother creating a scene graph, how to draw images to the screen or how to create a game loop. It is already there, ready for you to use it. Start with creating a new project from the Game template ...


1

1- Well, I have not a huge experience in IOS native development. But if you want it in environment like other Game Engines then I would recommend you to use SpriteKit. You can get start from this tutorial. 2- If you want to set Game Loop in normal Objective-C environment, you can set NSTimer with custom frequency like, NSTimer myTimer =[NSTimer ...


1

to simulate a black hole, I suggest to use SKFieldNode and vortexField(), adjust its strength and falloff property (default is 2). Setting a big number for strength will makes a big perpendicular force which simulates an angular force too (tangant to its imaginary orbital path around the black hole). And let the physics handle the rest, just dont touch ...


1

You have two solutions: 1 - Set scale of your gamepad: self.gamepad.scale = 0.5f This will make all the gamepad look smaller (the main circle and the direction sprites, as they are child of the main circle). 2 - Create a init method with a size, and calculate there the size of your childs: -(id)initWithJoystickWithSize:(CGSize) size andImage:(NSString *...


1

This may be a blatant hack, but Unity now let's you use a custom xib for the splash/loading screen. Maybe you can attach it there. Edit: I forgot, this feature is Pro only.


1

In simple terms a common design in SpriteKit games is scenes, layers, nodes and child nodes. You might make each part into a discrete class that encapsulates all of the parts, properties and methods. For example a Background class that has layered images, particles, various properties like the speed each layer should move and public methods to start and ...


1

Don't rely only on the storyboard to do all the work in your game. You need some properties for which character is currently selected and other game states. Then in viewDidLoad and/or in the method for the Start Game button, set the bird.image to be blue if that's the status. To save off this info between runs of the game utilize the messages for ...


1

In your scene controller, you should do this inside -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event: UITouch *touch = [touches anyObject]; CGPoint touchPos = [touch locationInNode:self]; touchPos will have the position inside your scene, and you can do: if ([self.cardOne containsPoint:touchPos]){ //Do something CGPoint ...


1

The trick is to use the CCScrollViewDelegate methods to detect scroll events. Add a CCLabelTTF and call it _pageLabel. In Xcode, make the scene containing your scroll view adhere to the CCScrollViewDelegate : @interface myScene : CCNode <CCScrollViewDelegate> Then, in didLoadFromCCB, set the scroll view delegate to self : _scrollView.delegate = ...


1

Well, one way is to load the textures and keep a reference to them ourself. You could reimplement your code to something like: @interface TextureHelper : NSObject - (void) preloadTextures; - (CCTexture2D *) textureForImageNamed:(NSString *) imageName; @end @implementation TextureHelper { NSArray * loadedTextures; } - (CCTexture *) textureForImageNamed:...


1

This work! in cocos2d 3.x NSMutableArray *frames = [NSMutableArray array]; int frameCount = 0; for (int i = 1; i <= 5; i++) { CCSpriteFrame *frame = [CCSpriteFrame frameWithImageNamed:[NSString stringWithFormat:@"dice0%d.png",i]]; [frames addObject:frame]; } CCSprite *sprite = [CCSprite spriteWithSpriteFrame:frames....


1

By "endless levels" do you mean that there is no limit to the number of waves i.e. the waves keep coming until game-over? If so then you need to develop an algorithm that takes the wave number as an input and returns an set of enemies suitable for that wave. The most trivial of these would be to take the wave number and return a number of enemies or as ...


1

Have you looked into CCPhysicsSprite? Otherwise you can use the b2body.userData pointer to store sprite information after you've created your physics body.


1

Maybe try giving the objects and/or the plane some friction: btRigidBody::btRigidBodyConstructionInfo info(1.0, motion, boxShape, inertia); info.m_friction = 0.9f; blockRigidBody = new btRigidBody(info);


1

What you are looking for is called "actions". Here is how to post an action. // create an Open Graph action id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject]; [action setObject:objectId forKey:@"dish"]; // create action referencing user owned object [FBRequestConnection startForPostWithGraphPath:@"/me/fbogsample:...


Only top voted, non community-wiki answers of a minimum length are eligible