> For the complete documentation index, see [llms.txt](https://bryan-nguyen.gitbook.io/bryan-nguyen/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bryan-nguyen.gitbook.io/bryan-nguyen/about-me/projects/swift-accelerator-projects/lunar-survival.md).

# Lunar Survival

LunarSurvival – A SwiftUI Survival Game to teach people about the Moon

## Overview

LunarSurvival is an immersive survival game built using Swift and SwiftUI. After crash-landing on the moon, players must scavenge resources, craft tools, and build essential structures to survive. The goal is to either hold out for 7 days or build an antenna to contact Earth and be rescued.

## What I Used

- Languages/Tools: Swift, SwiftUI\
- Concepts: Game logic, state management, resource tracking\
- Platform: iOS/iPadOS

## My Role & Contributions

I designed and built the entire game from scratch, including the core survival mechanics, inventory system, and win/loss logic. I used SwiftUI’s state management to control player energy levels, and interactions with the environment.

## Key Features

* Resource scavenging system with randomized lunar items
* Energy depletion mechanic simulating survival pressure
* Interactive crafting and building system (e.g. for antenna)
* Two endings: survive 7 days or signal Earth for rescue
* Clean, SwiftUI-based user interface optimized for gameplay

<div><figure><img src="https://3900586549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruYoiQhGAflaoETaFA0t%2Fuploads%2F7ceht7qc71ztek5aP7RK%2FLunarSurvival1.webp?alt=media&amp;token=ac624b1c-c9de-4676-a6ac-b25d0d20633b" alt=""><figcaption></figcaption></figure> <figure><img src="https://3900586549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruYoiQhGAflaoETaFA0t%2Fuploads%2FVASTkDGqbcX4C6OJw6wJ%2FLunarSurvival2.webp?alt=media&amp;token=0a6bf76c-2969-4e9d-9b0d-e344af695312" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://3900586549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruYoiQhGAflaoETaFA0t%2Fuploads%2FdJCFbPIvw0mdGhBTIxP3%2FLunarSurvival3.webp?alt=media&amp;token=7589ef8f-e47d-433d-bf9c-aa3b37e2daac" alt=""><figcaption></figcaption></figure> <figure><img src="https://3900586549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruYoiQhGAflaoETaFA0t%2Fuploads%2FiA780Vahaqeur7Femd5O%2FLunarSurvival4.webp?alt=media&amp;token=c2f6ff48-a10b-4130-9cfa-a5182770c5ca" alt=""><figcaption></figcaption></figure></div>

## What I Learned

This project taught me how to manage complex game logic using SwiftUI and how to design state-driven gameplay loops. I also learned how to balance challenge and strategy to make survival gameplay fun and meaningful. Working with students from other schools was challenging but we persevered to publish our app&#x20;

Download the app on App Store! <https://apps.apple.com/us/app/lunar-survival/id6738861996>

{% @github-files/github-code-block url="<https://github.com/Bryan-SAP-Apps/LunarSurvival>" %}
