Hey DEV community! π I'm Gamya, an iOS developer and new here on DEV. So excited to be part of my first ever Game Jam! π Hope you enjoy it! π
This is a submission for the June Solstice Game Jam
π What I Built
Pride Trivia & Alan Turing Edition is an iOS trivia game built entirely with SwiftUI that celebrates two incredibly important themes this June:
- π³οΈβπ Pride Month β honouring LGBTQIA+ history, identity, and resilience
- π» Alan Turing β the father of modern computing, who was tragically prosecuted for being gay in 1952
The game challenges players with 10 multiple choice questions covering Pride history and Alan Turing's extraordinary legacy β with fun facts after every answer so you walk away having learned something new every time you play.
Connection to June Theme:
June is a month of profound meaning. Pride Month celebrates LGBTQIA+ identity and history. Alan Turing was born in June 1912 β the genius who cracked the Enigma Code during World War II, saving millions of lives, yet was prosecuted by the British government for being gay. Every smartphone, every computer, every app β including this one β exists in part because of Alan Turing. Building a game that celebrates both his intellectual legacy and his identity felt like exactly the right tribute for June. π³οΈβππ»
Features:
- π Rainbow themed UI with deep purple background and full rainbow gradient accents
- 10 trivia questions covering Pride history and Alan Turing's life and legacy
- π Shuffled questions β different order every time you play
- β Instant feedback β green for correct, red for wrong
- π‘ Fun facts after every answer
- π Live score tracking with rainbow progress bar
- π Results screen with personalised message based on your score
- π Play Again button to restart instantly
- π€ Share Score button
- π¬ Alan Turing quote on the results screen
π₯ Video Demo
π» Code
gamya-hub
/
PrideTriviaGame
A Pride & Alan Turning themed trivia game built with swiftUI
PrideTriviaGame
A Pride & Alan Turning themed trivia game built with swiftUI
π οΈ How I Built It
The game is built entirely with SwiftUI for iOS and structured across five Swift files:
Project Structure
PrideTriviaGame/
βββ TriviaData.swift β Question model and all 10 questions
βββ WelcomeView.swift β Welcome screen with rainbow UI
βββ QuestionView.swift β Question screen with answer logic
βββ ResultView.swift β Results screen with score breakdown
βββ ContentView.swift β App entry point, controls screen flow
Key Technical Decisions
Structs for Data Modeling
Each question is modeled as a Swift struct with four properties β the question text, an array of four possible answers, the index of the correct answer, and a fun fact to show after answering:
struct TriviaQuestion {
let question: String
let answers: [String]
let correctIndex: Int
let funFact: String
}
State Management
The entire app flow is controlled by just three @State variables in ContentView:
@State private var gameStarted = false
@State private var gameFinished = false
@State private var score = 0
SwiftUI automatically updates the UI whenever these change β no manual screen switching needed.
Shuffled Questions
let triviaQuestions: [TriviaQuestion] = [ ... ].shuffled()
One line makes the question order random every single game!
Rainbow Progress Bar
GeometryReader { geo in
RoundedRectangle(cornerRadius: 5)
.fill(LinearGradient(
colors: [.red, .orange, .yellow, .green, .blue, .purple],
startPoint: .leading,
endPoint: .trailing
))
.frame(width: geo.size.width * CGFloat(currentIndex + 1) / CGFloat(questions.count))
}
Score Based Results
var resultMessage: (emoji: String, title: String, message: String) {
switch percentage {
case 90...100: return ("π", "Outstanding!", "You're a Pride and Alan Turing expert!")
case 70...89: return ("π", "Excellent!", "You have brilliant knowledge of LGBTQIA+ history!")
case 50...69: return ("β", "Well Done!", "Good effort! There's always more to learn.")
default: return ("π±", "Keep Learning!", "Every question is a chance to learn something new!")
}
}
π Prize Category
Best Ode to Alan Turing
This entire game is dedicated to Alan Turing. Here's how:
- The quiz content β multiple questions specifically about Alan Turing's life, his work cracking the Enigma Code at Bletchley Park, the Turing Test, and his tragic prosecution for being gay
- The dedication β the welcome screen reads "Dedicated to Alan Turing (1912-1954)"
- The closing quote β the results screen features his famous quote: "We can only see a short distance ahead, but we can see plenty there that needs to be done."
- The theme β connecting Turing's identity as a gay man to Pride Month creates a meaningful bridge between his computing legacy and his human story
Alan Turing was the father of modern computing and a gay man persecuted by his own government. This game exists to make sure people know both parts of his story. π»π³οΈβπ
"We can only see a short distance ahead, but we can see plenty there that needs to be done."
β Alan Turing
π Happy Pride Month!
Top comments (2)
Thanks for posting π(β ββ α΄β ββ βΏβ )
Thank you so much! πΈ Really happy to finally have it out there.