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


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

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


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

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


1

CCParticleSystemBase has an autoRemoveOnFinish property. The name is self explanatory. This property is NO by default. So should be set to YES on creation for particles that have a finite lifetime.


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

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