Archives for 

swift

SpriteKit Game From Scratch, Swift 2.0, part 4

    Introduction Hi and thanks for following this tutorials so far! This would be the fourth and final part. So far, if you have followed the previous 3 parts you should have a working simple game. The current project files are located here: SpriteKit tutorial part 3 files In this part we’ll look into adding […]
0

SpriteKit Game From Scratch, Swift 2.0, part 3

    Introduction Before I go on with this tutorial I just want to say a few words. The tutorial is getting quite long and for a few good reasons – I am trying not to leave a lot out and I am writing in in a raw format, meaning I am not refining it, […]
0

SpriteKit Game From Scratch, Swift 2.0, part 2

    Introduction   We’ll continue with our tutorial on creating a SpriteKit Game from scratch. Last we took off where we were able to create an instance of our hero on every tap on the screen. However we won’t really be creating our hero or the enemy with a tap on the screen, we […]
8

SpriteKit Game From Scratch, Swift 2.0, part 1

    Introduction As I foresee this to get a little longer I might have to split this up in two or more parts. There are already some tutorials out there, but I have found that most of all are missing some vital things. They might be useful as a place to start and by […]
9

Saving and Loading Text in Swift

    Here is a full solution on saving and loading text with Swift 2.0, current example is for saving and loading high score in a game. Using those 2 functions we can now declare a variable to store a path to our highscore text file: Here is how we would load  text […]
6

Get file in local Directory

If you have been using the old way of Swift 1.2 to locate files in your local directory and documents folder, you can forget about that in Swift 2.0 in the latest Apple update of iOS 9.1 and Xcode 7.1. Before you would use something like: After I had to do some headbanging I […]
2

Generating UIButtons from a loop, part 2

Hi, creating a second part of the tutorial as some folks wanted to do this trick with a few variations. ( link to part I ) As a start a Navigation controller got involved 🙂 So you end up with a problem where buttons would disappear as you go back and forth. Solution for this […]
8

Creating a HUD for your Sprite Kit Game

Creating a HUD for every game is vital. It’s a bit tricky when you are adding UI Elements to Sprite Kit and there are also a few different ways of doing it. Here is one of the ways and so far my favorite. It’s very flexible and it will allow you to easily customize your […]
8

Generating UIButtons from a loop

This is a very useful technique and it’s pretty straight forward. Let’s say we have an array of items or heroes and we want to dynamically create buttons that will do something linked to the hero/item selected. One example is if you have an array of saved games and you want to generate buttons to […]
20