I'm currently designing an iOS app in Object-C. The idea of the app is that you have some types of rockets Ships that navigate through an asteroid belt. It is played in portrait mode, there are two different types of asteroids, normally when you crash them, and shoot to get coins, then you are golden.
Now this problem occurs when the bullet and a gold asteroid are detected when the collision between the player and a normal asteroid is all right, and you lose but when a bullet and A collision between a gold asteroid is detected, so I get a signature error. | (SKPhysicsContact *) Contact {collision = uint32_t (contact.bodyA.categoryBitMask: - (zero) didBeginContact
: Code code that detects collision The following is contact.bodyB.categoryBitMask); If (collision == (player category | asteroid range)) {[Self-player ((SKPintNode *) self The player did: Cleared with Asteroid: (SKSPRTNode *) self. } Uint32_t collision2 = (contact.bodyA.categoryBitMask | contact.baB.categoryBitMask); If (collision2 == (bulletCategory | goldAsteroidCategory)) {[Self-tablet: (SKSpriteNode *) self.bullet didCollideWithGoldAsteroid: (SKSpriteNode *) self.goldAsteroid]; }}
The code runs when "[self-player: (SKSpriteNode *) self.player didCollideWithAsteroid: (SKSpriteNode *) self.asteroid]," is called this:
- (zero) player: (SKSpriteNode *) player didCollideWithAsteroid: (SKSpriteNode *) asteroid {[self-runAction: [SKAction playSoundFileNamed: @ "Explosion.mp3" waitForCompletion: no]]; NSLog (@ "Hit"); [Self. Player removed]; [Self. MasterFoodFireParents]; SKAction * actionMoveDone = [SKAction removeFromParent]; SKAction * LostAction = [Sketchon Runblock: ^ {SC Transition * Explore = [Extinction Crossfidelity Duration: 0.5]; SKCine * Game overcitizen = [[GameoverCivil Allok] Initvith Size: Personalize: No]; [Self.view presentScene: SportsOlecin infection: reveal]; }]; [Self. Master plus action: [SKACection sequence: @ [defeat action, action mavone]]]; }
This code runs when "[Self-bullet: (SKSpriteNode *) self.bullet didCollideWithGoldAsteroid: (SKSpriteNode *) self.goldAsteroid]," is called:
- (zero) tablet: (SKSpriteNode *) tablet didCollideWithGoldAsteroid: (SKSpriteNode *) goldAsteroid {[self-runAction: [SKAction playSoundFileNamed: @ "ding.m4a" waitForCompletion: NO]]; NSLog (@ "Hit"); [Self. Remove the bull formforant]; [Self.goldAsteroid removeFromParent]; [Self plus oncone]; }
I believe that there should be enough information and code, but do not hesitate to ask me more, I will post whatever is necessary.
When I saw in the log, I noticed that there was a problem with the sound effect "ding.m4a" I changed it with other sounds in sound, and it works now I am not sure what is going on with the sound, but this was the problem.
No comments:
Post a Comment