SpriteKit: Creating a Bomb using Swift

  

 

    I wanted to create a bomb similar to the one in Fruit Ninja the game. Creating the actual bomb was not to hard. I designed the art using Illustrator and used SKEmitterNode to simulate a spark. 

    I ran into a wall when I wanted to add a flash effect once the bomb exploded. In Fruit Ninja this happens when the user swipes over a bomb instead of a fruit. If you search online for answers you will come across SKEffectNode. The problem with SKEffectNode is that it uses allot of processing power and it might slow down your game. After looking into SKEffectNode I realized that it’s pretty difficult to implement, the main reason for this is because it’s based off CoreImage. I personally have no experience with CoreImage, it seems like the two are pretty tightly connected.

    Luckily I ran into someones code where they used a white SKSpriteNode to create a screen flash effect. I realized that SKEffectNode would really be overkill for my project and decided to build a screen flash effect using a white SKSpriteNode. I also created a shake effect which is pretty straight forward. I linked my code below, if you have any questions feel free to contact me.

Source Code