IMD1 _ Mobile Game App (2)

I’ve redesigned my hero, and other characters.


스크린샷 2016-05-23 오후 7.21.11.png

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.

스크린샷 2016-05-23 오후 7.26.41.png

We will going to add a new file.

스크린샷 2016-05-23 오후 7.27.38.png

Choose ‘swift file’, and make its name BadGuy.swift.

And this is the code for BadGuy.swift.

스크린샷 2016-05-23 오후 7.55.54.png

스크린샷 2016-05-23 오후 7.56.01.png

Then go to the GameScene.swift.

This is the code for GameScene.swift.

스크린샷 2016-05-23 오후 7.24.39.png

스크린샷 2016-05-23 오후 7.24.52.png

스크린샷 2016-05-23 오후 7.25.03.png

스크린샷 2016-05-23 오후 7.25.13.png

스크린샷 2016-05-23 오후 7.25.26.png

스크린샷 2016-05-23 오후 7.25.35.png

스크린샷 2016-05-23 오후 8.22.03.png

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.

스크린샷 2016-05-17 오전 11.58.05.png

Choose spark. Then you’ll see this.

스크린샷 2016-05-17 오전 11.59.30.png

You can modify its shape, color, etc. I made it like this.

스크린샷 2016-05-23 오후 7.26.08.png

Our Hero.swift code is like this.

스크린샷 2016-05-23 오후 8.29.29.png

Now when the baddies touch with hero, the particle appears.

스크린샷 2016-05-23 오후 8.22.20.png

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!!

스크린샷 2016-05-17 오전 11.50.57.png





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s