Tag Info

Hot answers tagged

3

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

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 ...


2

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

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 ...


2

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 ...


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 ...


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

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

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 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

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 ...


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 ...



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