With the addition of win conditions, support for multiple puzzles, and the ability to rotate pieces, this basic jigsaw puzzle game is almost done.
SpriteKit
Developing A Jigsaw Puzzle Game Part 8: Rotation
Now that I have a game where pieces are randomly placed and the player can drag them into position to win the game, I want to make things more difficult.
When the game begins, as well as being randomly positioned, the pieces will be randomly rotated.
Developing a Jigsaw Puzzle Game Part 7: Winning
My puzzle pieces can be moved around and now I want them to snap in to place when the player gets them close enough to their correct location.
Developing a Jigsaw Puzzle Game Part 6: Interaction
Now that this simple jigsaw puzzle game has some (unnecessarily) advanced architecture, it’s time to take advantage of it to start making this “game” into a game.
Developing A Jigsaw Puzzle Game Part 5: ECS
If you thought writing 2,000 words about opening Photoshop or taking four weeks to start coding in Xcode were frustratingly slow, then this week’s post might make you want to set fire to your computer.
As I continue to build a jigsaw puzzle game in ridiculous detail, I want to spend the next 1,500 words getting the game to look and function exactly the same as it does right now.
Before you reach for the matches, let me explain.
Developing a Jigsaw Puzzle Game Part 4: Creating the Model
Three posts in to this series and so far all I’ve done it set up Photoshop (I warned you that this was going to be excruciatingly detailed).
Finally, it is time to open up Xcode and do something with all these assets I’ve created.
Handling Movement Part 2: Scaling and Z-Positions
In part one, I set up a Movement Component that moved sprites around a space without any regard for the type of scene that they inhabit.
However, many adventure game scenes have some sort of perspective where it’s possible for players to move around an object.
Imagine a game where, say, a character in a trench coat is visiting a square in Lecce, Italy. For some reason, there’s a crate in the middle of it:
Handling Movement Part 1: Getting from A to B
In my initial prototype I used SKActions exclusively to handle movement. It’s a fire and forget solution—I create an action with a destination point and a duration and run that action on a sprite. SpriteKit will move that sprite to the given point over the given time without me having to think about it again.
let moveAction = SKAction.moveTo(x: hasTarget, duration: length / moveSpeedInPointsPerSecond) sprite.run(moveAction)
It’s great for many situations. However, there are a few limitations: