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
๐ Pride Trivia & Alan Turing Edition
An iOS trivia game built with SwiftUI celebrating Pride Month and the legacy of Alan Turing, the father of modern computing.
What it is
A 10-question multiple choice trivia quiz covering LGBTQIA+ history and Alan Turing's life and contributions to computer science. Questions are shuffled into a random order each time you play, with instant feedback and a fun fact after every answer.
Features
- 10 trivia questions on Pride history and Alan Turing's legacy
- Rainbow themed UI with a deep purple background and gradient accents
- Shuffled question order every game
- Instant feedback โ green for correct, red for wrong
- Fun fact shown after every answer
- Live score tracking with a rainbow progress bar
- Results screen with a personalised message based on your score
- Play Again and Share Score buttons
- Alan Turing quote on the results screen
How to run
โฆ๐ ๏ธ 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 (3)
Thanks for posting ๐(โ โโ แดโ โโ โฟโ )
Thank you so much! ๐ธ Really happy to finally have it out there.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.