Gamifying Sunscreen || Part 2: Building, panicking, and then back to building
Or how I made an app that made me enjoy using sunscreen while fighting imposter syndrome.
This is Episode 3, Part 2 in the [Game On] series, where I attempt to design, code, and ship one new app every other month. Part 1 can be found here but the TL;DR is I’m writing an app that gamifies your sunscreen-wearing habits. I sucked at wearing sunscreen in Part 1 and apparently, now I’m great at it. Go figure.
Fourteen days and counting
I’m off to a hot start — with two weeks of research behind me and some banked code, all I have to do is copy/pasta what I’ve written already, throw in some awful UI, write some elementary business logic, and voila! Out pops the hideous prototype below.
My next step is trickier (or at least that’s what I tell myself). Dermatologists recommend reapplying sunscreen every two hours, so that means I need to let users turn red squares into blue squares to show which samples were protected by sunscreen but after two hours, I need that protection to end and become red again. And then the user can see, “Oh yea, I need to reapply sunscreen!”
Turns out, it’s not that tricky at all but I make it tricky by rushing into the code. The problem with “tricky” problems though, is that they often lead to tricky solutions. And tricky solutions tend to disguise themselves as “clever” solutions. And “clever”, in the dev world, is more synonymous with crazy and will have you looking like that dude from Always Sunny in Philadelphia when you try to explain the logic to your co-workers and teammates. But hey, this is a solo project with an insane deadline that I manufactured out of thin air so I said, “To hell with taking a step back and let’s. get. CLEVER.”
Why did you do it like that?
When I finally do give myself some space to think, I’m flooded with questions:
Why do I have so many sunscreen statuses?
Why am I making the user go back into the app after they apply sunscreen?
Where am I going to SAVE this data? Isn’t this going to be redundant since everything except sunscreen is saved to Apple Health?
My anxiety coupled with some new bugs that are showing up from my unnecessarily complicated business logic have me feeling not too great about myself right now. But it’s about to get worse because the perfect solution, the solution I should have started with, finally hits me square in the forehead:
Why don’t you ONLY save the date and times you apply sunscreen?
Then you can base everything off of those dates.
You don’t have to remember sunscreen states.
You don’t have to save/duplicate the Apple Health data.
You don’t have to force a user to go back into the app later.
It’s so simple.
Oh god, Daniel. You fucking idiot.
Maybe I suck at this
Let me repeat, maybe I suck at this. “It’s the only real logical conclusion,” is what my brain tells me. Because when I felt things starting to go sideways, I didn’t stop to reassess the problem — I doubled down and pushed through. I wasted days hammering out a “clever” solution when the easier and more bug-proof solution was right in front of me. So yea, one more time for the people in the back —
MAYBE I SUCK AT THIS.
And that’s how the spiraling begins:
Who are you kidding.
You’re a joke dude.
Look at this thing, who would use this / let alone pay for this.
You fucking clown.
You’re not a real engineer and you never were.
You’re just some bootcamp wannabe.
You got lucky at one startup seven years ago.
That’s almost a decade buddy.
You’re washed up.
You fucking suck.
You suck.
You suck.
You suck.
Therapy (and Lexapro) is a helluva drug
The only reason I didn’t spend the next seven days immobile in bed, continuously chanting “I suck” at myself like some sort of sadistic self-loathing mantra was because of my time in therapy (and Lexapro). Okay, fine. It’s mainly the Lexapro. But here’s what you need to know about Lexapro and other SSRI’s (speaking only for me of course), is that they don’t magically make any of the angry voices in your head go away. In fact, they’re still very much there. But what the SSRIs do for me is make my voice of reason louder, so both sides of the coin are finally at the same volume. Which, for someone who has spent most of his teenage, college, and adult years fighting a continuous voice in his head saying “you suck”, having another voice shout back, “you sure about that?” is incredibly comforting.
And so instead of a few days, I spend a few hours immobile in bed but then I move on. I try to channel some Coach Forsyth in me and inject some positivity by reminding myself how drastically my sun protection behavior has changed since starting this project (at least two if not three sunscreen applications a day). I also spend energy convincing myself how much easier and better the app is going to be with the simplified logic.
But honestly, beyond that, I have no other answer here besides “suck it up.” Here’s Mark Watney from The Martian phrasing it more eloquently than that:
I start the rewrite and I anticipate a dogfight from ripping out old logic and inserting new UI but it all goes rather smoothly. Everything about this new solution is simpler and because of that, I stumble upon another revelation that allows me to eliminate an entire piece of business logic that is always a slog: “user account creation”. Instead, I’m going to use a new Apple framework I’ve been wanting to try (SwiftData) that allows me to persist all of the user’s data locally. A win-win for everyone; no user sign-up is required and no saving of health data except on your personal device.
It brings me some relief and some much-needed momentum. I am back on track and soon have all of my sunscreen logging/tracking code out of the way. I don’t repeat my mistakes of the past and I take an extra day with an Excel sheet to figure out how I want to score the game. I then figure out how I want the animation to look. And, like Mark Watney but with much lower stakes, I solve each new question — one by one.
And somehow, at the end of our second fourteen days, we are feature-complete!!! Are there bugs? Definitely. But are we done with:
Viewing time in daylight from HealthKit? Yes.
Giving the user the ability to track sunscreen usage? Yes.
Calculating all that data into something readable and historical? Yes.
Live Activities? Yes.
Game logic? Yes.
INCREDIBLE. Onto Stage 3 it is then where we will polish, polish, polish.
But before that, maybe some show and tell?
And remember, these are ugly ON PURPOSE! 😂
Show and Tell
Sunscreen status bar with live activity button ⬇️
Scoring system for Hatch vs. Fry game ⬇️
Difficulty levels for Hatch vs. Fry game ⬇️
Animation for Hatch vs.Fry game ⬇️
What’s Next
Stage 2 of 3 is complete! The next (and last) fourteen days will be all about polish, where we try to make this thing as simple and delightful to use as possible.
However… if you’ve made it this far, a little spoiler / easter egg for you:
The app is already live and you can download it on the app store here!