Time for the latest and greatest to come out of Freeish Time! Just to refresh your memory, “Freeish Time” is the opportunity for our Cubes to focus on their passion projects outside of their work commitments. They have an entire week to identify a problem, build and create a solution, then present it to the rest of the team during our Friday Happy Half Hour meeting.
This has become an integral part of 3 Sided Cube. The encouragement and time to work purely on whatever their heart desires, all while getting a little reprieve from the normal hustle and bustle from the normal workload is a welcomed treat. Whether they opt to go the “innovation” or “education” route, that invaluable time to focus purely on whatever it is that intrigues them is pretty rad.
The sky’s the limit when it comes to Freeish Time. We got to sit down with Tom, our INSANELY talented developer and, server team lead extraordinaire to chat about his week of innovation.
What inspired your innovation time?
I love making small games using HTML, CSS, and JS. It reminds me of the early days of the internet when independent developers would build games using Flash and ActionScript. I guess I was hungry for some “circa 2008 Newgrounds” game development!
Candy Crush is a fairly well-known game so I thought it would be a good one to copy. I prefer to work this way as it allows me to focus on the programming as opposed to the gameplay design.
And imitation is the sincerest form of flattery, right?!
Talk us through what you did
Because I was focused on the development side of this project I decided to use emojis as the artwork (shout out to Twitter for open sourcing their emoji artwork). This meant I didn’t waste time trying to perfect the graphics before the core mechanics were solid. In the future, it wouldn’t be hard to reskin the game as I made sure to stick to the 16:9 ratio and use relative widths and heights for everything.
After hammering away at my keyboard for three days (and consuming a four-pack of Red Bull) the game was complete.
It’s quite a light codebase as there are only 600 lines of code or so (excluding underscore.js) and I’d like to think that makes it reasonably straightforward to understand… the source is unminified so you can try to read it and make up your own mind!
I think the next steps would be to :
- Improve the replacement of emojis, as mentioned below they’re a bit primitive.
- Give the UI some love. It’s rustic, to say the least…
What were the key learnings?
Netlify is an awesome platform! Everything about their developer experience is stress-free. For our commercial work, we host our front ends in S3 buckets sitting behind CDNs, however, if I was going to start another project elsewhere I would definitely consider Netflify for the front end.
Were there any challenges?
The recursive animation was a real pig to implement. It took me three attempts to write it in a way that didn’t suck. This has reinforced to me that mixing presentation logic and business logic is not the way to go if you want maintainable software!
Managing global state was a big problem in the beginning… I ended up simply having half a dozen globals attached to the window by the end of the project. While this is okay for a hobby game I’m not sure this approach would scale very well in time. A singleton with getters and setters would work better, although I don’t think you can escape the fact that all games need some sort of global state!
In the end, I had to change tact and implement a simple emoji replacement strategy. Ideally, the emojis would cascade down as Candy Crush does, however, I had to switch to a fading in the system. This limits the gameplay slightly (as there’s not as much variation in the board) so this is one area where I could definitely improve things!
How can you use this within your role at 3 Sided Cube?
I’m going to recommend the other members of the backend team to have a play with Netlify. I’m sure we could use it at Cube to save time and deliver prototypes with minimal fuss.
This project has reinforced my view that the split between frontend and backend will only grow larger in the future. It’s just not feasible for a full stack developer to compete with dedicated frontend and backend developers these days, especially as projects demand more from each role. That’s not to say that developers from each discipline can’t learn skills from each other by any means!
As always, it’s so great to hear about what exciting things our team gets up to when they get the time to run wild with their ingenuity! Until the next Freeish Time, everyone.