I’ve redesigned my hero, and other characters.
So I added characters to the Assets.xcassets.
Change the name of the characters. I changed them ‘boris’, ‘natasha’ and ‘paul’.
Jeff will be our hero, and boris, natasha, paul are baddies.
We will going to add a new file.
Choose ‘swift file’, and make its name BadGuy.swift.
And this is the code for BadGuy.swift.
Then go to the GameScene.swift.
This is the code for GameScene.swift.
You can see that baddies keep moving upside down.
You can also move jeff vertically by clicking.
Now we are going to add a particle effect.
Choose spark. Then you’ll see this.
You can modify its shape, color, etc. I made it like this.
Our Hero.swift code is like this.
Now when the baddies touch with hero, the particle appears.
Also when the hero get hit, the ‘OUCH!’ sign appears. And when baddie go through the screen out, you can get a score. So cool!!