by Renan Magagnin
How I Won a Scholarship to Apple’s Yearly Event for the Second Time
WWDC Scholarships reward students from all over the world with the opportunity to attend Apple’s yearly event. Developers selected for a scholarship receive a WWDC ticket, lodging for the conference, and one year of membership in the Apple Developer Program free of charge.
I was a student at the Apple Developer Academy and this was my second time winning the scholarship — my project from last year can be found here. I was incredibly excited with the news and thought I would share the process behind the game that allowed me to receive this opportunity once more.
In Mindblower, the objective is to blow minds. To achieve this, the player shoots sticky grenades which are affected by vector fields. The core loop is to analyse each level, come up with a plan, and shoot precisely.
The idea was to optimize the movement of a large number of entities by using vector field equations to determine their velocity.
The prototype shown above proved that this could, indeed, be the base mechanic for the game. Now, it was time to come up with the main elements that would allow for interesting gameplay:
- Slingshot: Allows the player to shoot balls by determining their initial velocity, given the fixed position of the slingshot.
- Objective: Upon contact with at least one ball, registers that the stage is complete.
- Obstacle vector fields: These exist in an attempt to prevent the player from achieving the goal.
- Inverters: Upon contact with a ball, rotate the orientation of every vector field in the stage by 180º degrees.
- Portals: Exist in pairs and any ball that enters through one portal, comes out the other.
The next step was to create stages that, in an interesting way, would progressively introduce the game elements and get increasingly challenging.
To achieve this, there was a lot of experimenting with vector field equations to find the ones that would fit the game. Then, combinations of these vector fields and the other game elements gave shape to the stages in the final version of the game.
Since, at this point, the idea was well defined and the stages were already planned, it was easy to identify what systems would be required and what they would need to support. It also became clear that the key part would be to facilitate the construction of stages.
With this in mind, vector fields were engineered to support customisation of their acceleration equation, shape, strength, colour and transparency.
This allowed for different stages to be created in a rather elegant and easy way — supporting even multiple slingshots or objectives. It also avoided the repetition of code and achieved all the compositions present in the stages planned for the final game.
The graphics were created with Sketch and SpriteKit particles. The intention was to follow the neon theme of WWDC19 and take literally the phrase from Apple:
“Write code. Blow minds.”
The core loop made up by a slingshot shooting balls at a larger ball that represented the objective was upgraded. Now, a neon bow shot sticky grenades at a mind to be blown. This was not only more visually appealing, but also more intuitive.
And, in order to make success more satisfying, it was important to focus on its core part: the explosion.
This result was achieved using four different particles and several SKActions to programmatically create the bounce on contact and the pieces of the head flying everywhere (which were exported as 9 different assets).
As a final touch, it was also important to — with animations — make the neon lights feel real. To get this right, it took much observation of references on the internet and A LOT of fadeTo(alpha) and wait(forDuration) SKActions in the code.
The audio was made from a mix between online sources and some sound effects created on Garageband. For the implementation, SpriteKit actions and the AVFoundation framework were used.
Adapting to the PlaygroundBook Format
Since the game was made entirely with Spritekit, the transition was almost stress-free, only requiring the classic requirement of marking almost everything in the code as public.
The last step was to provide an instructions page in the playground book. The goal was to have it contain only the necessary instructions, while also keeping it as concise as possible, in order to keep the focus on the game.
In retrospect, I believe that what contributed most to the quality of the final result were the following:
- Being curious: Interesting ideas can come from anything. For me, it was when I asked myself: “How did the people from Frost do that? How would I do that?”
- Coming up with a plan: Validating the idea before even thinking about the implementation was crucial. Having a clear idea of the end goal made identifying the best approaches way easier.
- Creating for people: Have the experience of the player/user be your number one priority. Revolve every decision around it.
Thank you very much for reading. If you have any questions, suggestions or comments, feel free write them in the comment section below or send them to me directly, I will be glad to answer.