SpriteKit games
SpriteKit Games

Why this app?

I've written a couple if games apps; one for the MAC and one for the iPad. Both were relatively simple, low graphics game compendiums. While they were fun to write and I still play them now, there was nothing arcade about them. The graphics content was just enough to make the game look good.

I felt the urge to make something more graphical and Apple's 2D graphical game engine is the old (very old) SpriteKit framework. So I figured I should have a go at something more arcade like using SpriteKit.

I started with Paul Hudson's tutorials which game me a basic grounding in SpriteKit and led to four games. The first of these was a space game that has kept me amused and challenged for a while now.

Key Learning Points

What did I want to achieve?

The basic games I produced for the Mac and the iPad were all simple, low graphics, affairs. I needed something with a little more punch. SpriteKit provides that punch but is like nothing I've coded in Swift before.

The primary purpose of this project was to see how the SpriteKit framework hangs together and to challenge myself to create something more graphical. Graphics is not 'my thing' and creating assets for graphical games was always going to be an issue. Pauls book game me some starter images but I quickly found that, if I were to expand the games, I would need to create images of my own.

The aims of this project are simple;

  • iPad games created with SpriteKit.
  • Creating graphics using Affinity Designer on the iPad.
  • Creating fun games with high graphical content.

Acknowledgements

  • The basics of SpriteKit and the basis of some of the apps here came from the book by Paul Hudson Dive Into SpriteKit . An excellent foundation into this technology.
  • The music has come from the web site of Kevin MacLeod which is released under the Creative Commons: By Attribution 3.0 License. There is a vast wealth of sound here.
  • Some of the artwork for these projects was taken from the Kenney Game Assets packs.
What it looks like

And the end result is...

My current list of games includes:

There are more to come...

Asteroids

On the face of it, Asteroids is a simple game. It is, however, frustratingly difficult to play and involves a healthy level of panic!

Asteroids game

When the game starts, a star field will be generated that moves from right to left. This creates the feeling of movement for the space craft. The game then starts generating asteroids for the player to avoid. By pressing on the space ship, you can move it around the screen and avoid colliding with the asteroids.

Once I had the basic game sorted out, I set about enhancing it to make it more appealing and to inject a level of difficulty. The original version of this game was produced by Paul Hudson in his Dive Into SpriteKit Book . I extended the game to include;

  • A variable gap between generating asteroids so they were not evenly spaced.
  • Made the asteroids variable size and gave them a spin.
  • Changed the icon for the energy boost to something more 'atomic'.
  • Changed the scoring system. You now have a limit on your fuel reserves which you must replenish with energy boosts.
  • Track the time you are playing.
  • Added a toolbar to control whether sounds are playing and to allow the player to pause/resume the game.
  • Added a popup window to track high scores.
  • Creating SpriteKit 'components' to encapsulate game play functionality

Creating the game has bee a great learning experience. Getting information on SpriteKit has not been easy but it is all out there if you look hard enough. It proved particularly difficult creating components. In SwiftUI it is natural to split out functionality into sub-views, so it felt natural to do that with SpriteKit. It turned out to be challenging, but do-able. I split the dashboard and toolbar into their own separate components.

Source code

The source for the Asteroids program is available on my GitHub page in the Asteroids repo.

Back to game list
Testimonials
Testimonials

Am I really any good?

Don't take my word for my abilities, take a look at other peoples opinions about me.