You must be a Pro member to watch this episode.

Get Access Now

Sign in now if you're already Pro.

1

Create a SpriteKit Game Project

11:21FreeDone
2

Lay Out the Game UI

8:54FreeDone
3

Define the Game Piece Model

13:16FreeDone
4

Create the Level Model

5:47FreeDone
5

Draw the Rune Sprites

6:02FreeDone
6

Detecting Taps on Runes

5:27ProsDone
7

Determine Swipe Direction

6:18ProsDone
8

Add Physics to Shatter Runes

14:00ProsDone
9

Build Out the UI Text

12:24ProsDone
10

Keeping Score

8:41ProsDone

Displaying Score Feedback

8:18ProsDone

Displaying Score Feedback

Published by Chris Slowik

Episode Notes

Extra tips from the author

Players Love Feedback

It’s not enough to just update the score. Let’s add some pizazz in the form of floating score labels! Other forms of feedback could be a vibration or sound. We'll consider those in a future lesson - right now we're focused on scores!

The images are included in the source file link for all the possible rune scores. It’s a limited list based on our game rules, so we can pre-render the numbers.

func spawnScoreFloater(for rune: Rune, value: Int) {
    let scoreSprite = SKSpriteNode(imageNamed: "\(value)")
    let scorePosition = pointFor(slot: rune.slot)
    let positionOffset: CGFloat = rune.runeType == .right ? 50 : -50

    scoreSprite.position = CGPoint(x: scorePosition.x + positionOffset, y: scorePosition.y)
    scoreSprite.run(SKAction.moveBy(x: positionOffset, y: 5, duration: 1.5))
    scoreSprite.run(SKAction.scale(by: 1.5, duration: 1.25))
    scoreSprite.run(SKAction.sequence([SKAction.wait(forDuration: 1.5), SKAction.scale(to: 0, duration: 0.25)])) {
        scoreSprite.removeFromParent()
    }

    scoreSprite.zPosition = 100

    addChild(scoreSprite)
}
Episode Topics: