ios - Spritekit Game Scene stop when first time contact after add Game Center to the game -
i use sprite kit, , before use gamecenter, goes fine, after add gamecenter, problems come. after game scene shows first time, when 2 sprite contact first time (note here add score), game scene stop around 2 seconds, , fps around zero, before around 60, strange, right? after contact, goes smoothly then, happen when first time after launch game, , did changes. firstly, comment out code adding score when 2 sprite contact, , strange, scene not stop now, earthing goes fine, have add score, because user win score. did advance contact before game start, means original score -1, , did advance contact, when game starts, score started 0, unexpectedly, scene still stop when user playing when first time 2 nodes contact, not know problem now.
note that, why said problem game center, because when not connect internet , goes smoothly, means not add score game center. strange again, guess problem must adding score gamecenter, comment out method add score game center, guess fine now, , problem still happen, nothing can do, why problem, did 1 of met problem before?
my code:
let' if collision == physicscategory.basket4 | physicscategory.bugnode { if contact.bodya.categorybitmask == physicscategory.basket4 { contact.bodyb.node?.removefromparent() } else{ contact.bodya.node?.removefromparent() } scoreama++ println("get teh shittttttttttttttttttttttttt") scorelabel.text = "(scoreama)" finalscore1.text = "(scoreama)" showscore() } '
if call game center function gamescene bring game center code gamescene , change 'view' 'self.view!'. should work!
Comments
Post a Comment