Paris Buttfield-Addison
Parallax scrolling for iOS with Swift and Sprite Kit
Learn how to add this popular visual effect to your iOS project.
Up until the mid 1990s, the pinnacle of video game graphics was parallax scrolling: the use of multiple scrolling backgrounds, which created a sense of depth and perspective in the game. When you’re being a 2D game in Sprite Kit, you can create this effect by creating multiple sprites, and managing their position over time.
In this example, we’re creating a scene where there are four components, listed in order of proximity:
- A dirt path
- Some nearby hills
- Some further distant hills
- The sky
You can see the final scene below:
Multipeer Connectivity on iOS 8 with Swift
Discover, connect, and transmit data between devices.
Multipeer Connectivity is a means of identifying and connecting services together, and allows for very easy passing back and forth of data with minimal setup. If you are thinking that this seems similar to Bonjour, you are correct; however, Bonjour is for service discovery, not connection or transmission. Multipeer Connectivity handles everything in one neat package.
Multipeer Connectivity is comprised of a few different components, but it works by having applications advertise their services asking if anyone is available to connect. The service browser listens for these advertisements and can request to create a connection between the devices. If the connection is accepted, a session is created with every one inside the session being represented by a peer object.
To demonstrate how this works, we’ll make a simple chat application using Swift, Apple’s new language.