Kodeco Forums

SpriteKit Tutorial for Beginners

In this SpriteKit tutorial, you will learn how to create a simple 2D game using SpriteKit, Apple's 2D game framework, while writing in Swift 4!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/71-spritekit-tutorial-for-beginners

Thanks for the nice tutorial. One thing I was a little confused about was: what was preventing the game from ending in a loss when you shoot a monster. It was not quite clear that shooting the monster (thus removing the sprite) also interrupted the sequence of actions that is set.

Here is the tutorial code in Swift3 if you want:

@wviper3 Can you please help with this when you get a chance? Thank you - much appreciated! :]

Thanks for this awesome tutorial! I’m very new to SpriteKit and also in iOS development world but I’m learning fast thanks to tutorials like this. Hope that someone could answer the questions we could have though :wink:

Thanks for this tutorial! It’s really great! I’m having an issue though. It seems like when I run this project, the projectile and monster doesn’t touch, but it registers as a “Hit” and both objects are removed from the screen. Why does that happen? How can I get this to work more accurately?

Hey @Icarmer, glad you liked the tutorial. Are you running this on the simulator or a physical device. The frames will render much smoother on an actual device, which may be the cause of the projectile not appearing to hit the monster. They may be touching but the screen just hasn’t caught up. If not, could you upload and link your project so I could take a look?

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!