Swift Playground Project "6 Feet Between" written by Ritam Debnath is a game written completely with SwiftUI and without any game Kit or engine.
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