/SixFeetBetween_WWDC20SwiftChallenge

WWDC 2020 Swift Student Challenge Submission "6 Feet Between" by Tony Tang

Primary LanguageSwiftMIT LicenseMIT

SixFeetBetween_WWDC20SwiftChallenge

Swift Playground Project "6 Feet Between" written by Zixuan(Tony) Tang is a game written completely with SwiftUI and without any game Kit or engine. The project has been accepted by Apple, being one of the 350 winning projects around the globe.

You may watch the demo screenrecording of this project on YouTube at your convenience.

Context

In year 2020, Apple holds the Swift Student Challenge for the first time. Candidates are required to showcase their love of coding by creating an incredible Swift playground on the topic of your choice. This challenge is open to students around the world.

Words from the Author

My iPad Playground Book project named “6 Feet Between” is an interactive game that harnesses the power of the latest Apple software technologies to provide an immersive experience. This game is intended to educate people about keeping social distance as a hygiene practice. In the game story, the human is facing a crisis caused by a virus. The player will become a ninja who tries to save people’s lives by transporting a research sample from the lab to the factory. The ninja needs to keep at least 6 feet away from other pedestrians on the way to the destination.

Providing the player with an interactive and entertaining experience, the game comes in three parts, the background story, the instruction, and the game scene. The background story page greets the player when they first open this project. The whole story will be told concisely, along with visual patterns and animations. Simple diagrams combined with animated symbols help the player to understand the game context. The instruction page introduces basic playing actions and rules to the user, providing an experimental ground for the player’s moves. After the user is fully loaded, they will enter the game page to put all they have just learned into practice. After the game ends, the player will receive a card showcasing their game performance. The game also lively adapts when user switch to dark mode.

The latest Apple software technologies, including “SwiftUI,” its internal Metal off-screen rendering, along with “AVFoundation” and “PlaygroundSupport,” are implemented to build this interactive game. In creating “6 Feet Between”, I took a fundamentally different technical approach from other games. More specifically, it is a game that is built up without a game framework. While other 2D games are mostly based on “SpriteKit” or “SceneKit,” I built “6 Feet Between” entirely on the “SwiftUI,” which just came out barely a year ago. Although being comparatively new, SwiftUI provides surprisingly high performance and rich animations that allowed me to build a game from the ground up. Although it was not easy to start off with, I managed to dive deep into the documentation for the powerful technology of “SwiftUI,” including its off-screen view rendering using “Metal.” I also used multithreading technology throughout the project for smooth animation rendering for every UI element in this project. However, interaction is more than just visual appearance. By using “AVFoundation,” I have integrated user actions with sound effects. Therefore, every time the player clicks a button, moves on the screen, or ends the game, subtle sound effects provide clear feedback.

More Info

At the time of this commit, I just finished my first year of college as an international undergraduate at UCSD(University of California San Diego). Growing up as a techie, and now as a developer, I am aware of the importance of being supported and the feeling of belonging. Feel free to ask me any question you have encountered, and I am more than happy to help out if I am able to!

Follow me at: