Hello I've made an iOS game named 'Racing Horses' and published it to App Store. It was fine with playing on iOS 8.x.x, but after I installed iOS 9 Beta 3, in the same game (same codes), iPhone cannot recognize multiple touches. I have to leave my finger to make the next touch. But it was not like this, I could make a new tap even if I still hold my previous tap. What is the problem, what should I do?
SwiftUI's SpriteView lets us render any SKScene subclass right inside SwiftUI, and it will even resize the scene if you request it. The game scene you create is fully interactive, so it works just like a regular SKView would do in UIKit.
The SpriteKit framework makes it easy to create high-performance, battery-efficient 2D games. With support for custom OpenGL ES shaders and lighting, integration with SceneKit, and advanced new physics effects and animations, you can add force fields, detect collisions, and generate new lighting effects in your games.
SpriteKit and SceneKit are iOS frameworks designed to make it easy for developers to create 2D and 3D assets in casual games.
SpriteKit is a general-purpose framework for drawing shapes, particles, text, images, and video in two dimensions. It leverages Metal to achieve high-performance rendering, while offering a simple programming interface to make it easy to create games and other graphics-intensive apps.
I had the same problem on a game launched this summer.
I had to explicitly enable multiple touch in the SKScene
:
-(void)didMoveToView:(SKView *)view {
self.view.multipleTouchEnabled = YES;
}
Here's more detail -
The game uses sub-classes of SKSpriteNode
.
They test for number of touches depending on the the sprite.
In the sub-class:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"TapCount = %lu", (unsigned long)touches.count);
if (touches.count == 2) {
// do something
}
}
It looks like as of ios 9 multitouch has to be explicitly enabled. I don't think this used to be the case. I now have this issue on all my spritekit apps. Just adding self.view.multipleTouchEnabled = YES; in viewDidLoad, fixes it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With