Thanks for this article, the reason I don’t have subscribed ray lessons yet, it’s because the lack of more SpriteKit teaching/ideas.
Maybe now with Swiftui I jump on.
Thanks
Note. Physics are broken on Xcode 11 running macOS Catalina. Collision map doesn’t fit the asset.
There’s a bug—after you complete the level and it starts over, the next time you cut a vine it crashes. It turns out that the check for backgroundMusicPlayer == nil happens again after the first level—the static player is still in memory and so the setupAudio() method skips initialization of the rest of the sound effects. To fix this just make the backgroundMusicPlayer property non-static. (There’s no reason for it to be static anyway.) I’m also happy to see some Spritekit content again. This was a fun distraction!
Contact of prize with crocodile is not working - prize always falls through croc. A build/run on the Final project provided has same problem.
I’ve tried changing build target in case that somehow affects it - no difference. Checked my implementation to make sure it was done as specified - then even recopied from the tutorial over my implementation just in case - no change. Checked the bitmask settings, changed them to test, and even implemented the values as 0b binary just in case - no difference.
Wondering if maybe SceneKit has changed with WWDC20 / and or Xcode 11 possibly to where additional or different implementations of Physics / contact / bitmask methods need to be updated now? Newby to SceneKit, Swift so unsure.
Update - issue fixed:
I downloaded and used Simulator 12.4. Xcode → Preferences → Components, then download.
It appears the culprit is a combination of the Simulator and when the PhysicsBody’s shape is defined by texture.
The Simulator I used with the issues was Version 11.5 (921.9.1) / Xcode Version 11.5 (11E608c).