Gamifying Sunscreen || Part 1: Game On
I suck at wearing sunscreen but I am even worse about reapplying it. So can I make an app to help me be better at sun protection?
This is Episode 3, Part 1 in the [Game On] series, where I attempt to design, code, and ship one new app every other month (yes, every other month now — see why here for the new workflow). If this episode’s title resonates with you, DM me and I will be happy to invite you to the beta!
I have lived most of my life in Southern California, and for most of that time, I have been downright awful at putting on sunscreen. Whether I’m out golfing, running, or vacationing in Croatia during an unprecedented heatwave — that second layer of sunscreen never makes it on until my skin starts to turn noticeably red and visually screams at me, “Oh yea. Some more sunscreen would be nice now.”
I was content to play this dangerously naive game of chicken with the sun (sorry Mom) until I saw a stat in the Apple Health app called “Time in Daylight.” Apparently, your Apple Watch has a sensor that can determine your time in daylight and the maximum light intensity during that time. Amazing!
So being the curious iOS developer that I am, my caveman brain said:
I have problem.
I have data.
Can I build solution? 🤔
It has to be a game.
This is the only thing I know from the outset: if it’s not a game, it’s not going to work. “Wear sunscreen” is a directive that falls in the same bucket as “stay hydrated.” You are either one incredibly disciplined human being and don’t need technology to remind you to drink water or you are a perpetually dehydrated and (probably) sun-burnt individual.
So during the day, I dig through code videos and documentation to familiarize myself with new frameworks. I dig deepest into HealthKit and Live Activities because these are the two cornerstone features of what my app will rely most heavily on. I create a sample project with nonsensical UI and experimental spaghetti code to see if what I see in my head lines up with reality.
During the evening, I rack my brain about what the game’s core concept should revolve around while Ali is watching Emily in Paris (OK fine, I’m watching it too). I gravitate towards objects that could simultaneously grow and die with varying degrees of sun exposure (fruits and plants). Or current video games that have a “shield” aspect to them like “Bubble Bobble” or a game like “Overcooked” where too much of something ends up not being a good thing. Or even Tamagotchis! All of these seem not quite right so I even go as far as to google “sunscreen gamification” and am taken to a research paper on sunscreen gamification experiments happening in Australia (they created a VR game where you are inside the body targeting and destroying cancer cells. Think Time Crisis meets Innerspace — and yes, I am throwing a whole lot of nostalgia at you in this one paragraph 👴🏻). None of this is what I’m looking for but I am slightly comforted by the fact that this is clearly a real problem that other people are trying to solve too.
How do you gamify sunscreen?
And so, three days go by like this: code exploration during the day, head knocking on the wall trying to figure out the path forward for a game at night. When finally, a breakthrough occurs when I least expect it.
I’m walking over to a Lagree class on a Saturday morning and making sure I have my grippy socks and water with me when all of a sudden the word EGG pops into my headspace. Not a mayon-egg like in Arrested Development (although I legitimately did say “her?” in my head), but like a chicken egg. Because if my memories from third grade science serve me correctly, an egg needs heat to hatch. But if you go too far, well, then you have breakfast.
This is the perfect visual I’m going for in the app. It’s sensible, playful, and also slightly morbid — the egg hatches into a chicken if you wear enough sunscreen throughout the week or the egg drops into a frying pan if you don’t! It’s perfect!
How does the scoring work in this egg game?
TBD.
OK, fine. I’ll expand (a little). As outlined in my new project work flow, these first fourteen days are only for technical discovery. Sure, there will need to be time spent on some sort of equation to determine whether an egg hatches or fries, but for now, the concept is all I need and so I do my damndest to ignore the scoring system and stay focused on fleshing out the code.
But wait, what the hell am I trying to do again?
I am about ten days in and this has been my daily routine:
choose a product idea or feature hypothesis to test
write experimental code for chosen feature
discuss the validity of chosen feature with Frank (the dog)
(Note: “Discuss” sounds better than “talks to self while walking dog” so let me have this one, OK?)bank the feature code for the real thing next week or throw it away
repeat
It’s been productive but my brain has been all over the place. I have explored HealthKit, Control Center, Live Activities, Push Notifications, Widgets, and more. Some of these explorations were unnecessary rabbit holes to answer questions I don’t need answered (because I’m not adding them to the app) like “Why won’t the toggle UI stay on in the control center when tapping on it?” or “How to start a live activity from a push notification?”
I also spent time learning what the Maximum Light Intensity metric is by reading research papers on illuminance and seasonal affective disorders (FYI the recommended amount of lux is 10k at 30 minutes per day so 300k total). All of this learning is incredibly fun but my brain is definitely a bit scattered.
I need to take a moment to create something clear and concise to bring me back on track when I start going sideways. Here’s what will be my two guiding principles for the rest of this project:
Encourage sunscreen use before going out
Encourage the reapplication of sunscreen while out
No school like the old school
For the final two days, I put away the computer and get out a pen and pad. I need to make better sense of the data coming from the Apple Watch, so I transcribe the readings in the Apple Health app down on paper. It is a bit of a pain going through every sample recorded for two days, but it is also immensely helpful. It gives me a full understanding of what can be extracted from the data. Stats like:
Total minutes per day in the sun
Total minutes per day with sunscreen
Total estimated lux (light intensity) intake for the day
Total estimated lux with sunscreen
Total number of high lux (>=15k) exposures
Total number of high lux exposures with sunscreen
Total number of sunscreen applications per day
This data (and the way I currently have to fetch, record, and make sense of this information) gives me confidence that there is value in what I’m trying to do here and that there is a path forward. A game can be shaped from it, I just don’t know if it can be done in fourteen days… so stay tuned!
What’s Next
Stage 1 of 3 is complete! The next fourteen days will be about building a rough, but feature-complete, version of the app. If you want in on this little adventure, DM me or leave a comment below and I’ll get you in on the Testflight beta build!