Rotates.org

June 26, 2025 - CodePen greatest hits pt. 1

I’ve always enjoyed short, snappy little projects that deliver a quick dose of dopamine, and I’m a big fan of CodePen as a way to exercise that ‘tinker and play’ attitude.

One of my earlier and more involved pens was the result of a thought: “What if 8-bit but open world?”. A great candidate seemed to be Jet Set Willy, and luckily there’s an absolutely excellent disassembly of the game available. It was fascinating to dive into the data and see how efficiently everything was packed in there while remaining pretty readable. Before the days of widespread fast and convenient compression, programmers just squeezed things down to the last bit.

I ended up writing various routines to process things in a way that looked true to the original, including figuring out how to parse the attributes (the way the Speccy encoded colour and more into 8×8 pixel blocks with a single byte) and generate all of the graphics, rooms and movement patterns.

It’s not complete unfortunately – the arrows and the rope swinging routine got the better of me at the time, but I still think it’s still a really cool little bit of nostalgia, and decently structured (for the time at least; this is pre-ES6 JavaScript).

Anyway, here it is in all its glory. Enjoy!

I quite like the big comment attempting to explain all the bitwise stuff:

    // The attribute format is a single byte containing 2x 1-bit values for flash and bright, then 2x 3-bit values for paper and ink
    // So the value 221 (binary 11011101) broken down becomes flash 1 (1), bright 1 (1), paper 011 (3) and ink 101 (5)
    // To extract these, we perform up to two operations:
    // 1. We perform a bitwise AND on the value with a bitmask of corresponding length for how many bits you want to extract - if 
    // we're looking for a boolean here (using a single bit in the mask), we can just coerce it with the !! operator as the outcome
    // will be zero for false and non-zero for true
    // 2. We perform a bitwise shift to the right so that the bits we're interested in are at far right side
    //
    // Examples:
    // To get the bright value (1 - true) from 221 (11011101):
    // 221 & 64 = 64  (binary: 11001101 AND 01000000 becomes 01000000)
    // !!64 = true    (binary: 01000000 is non-zero, so it becomes true)
    //
    // To get the paper value (3) from 221 (11011101):
    // 221 & 56 = 24  (binary: 11011101 AND 00111000 becomes 00011000)
    // 24 >> 3  = 3   (binary: 00011000 shifted right 3 times becomes 00000011)
    //
    // Quite a nice explanation of what you can do with bitwise operators can be found here:
    // https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators
    // 
    // P.S. I revised this whole intro in September 2020 as I realised I didn't understand bitwise operations as well as I should
    // have. Littered throughout this code are examples of the old inefficient method of "shift then and", as opposed to the
    // 'correct' way of doing things (especially for single bits). No doubt there's more on this for me to learn but it's good to
    // be honest.

I’ll write up a few more of these for other pens I’ve done if there’s any interest. Let me know in the comments or via one of my socials if you’d like to know more about any of these, or indeed anything else I’ve done!

June 22, 2025 - Touch-ups

I’ve been recently promoting some of the stuff I do on social media, and I noticed this site was, quite frankly, very tired. It didn’t work properly on mobile, the custom font had stopped working, media links had all been broken for years, and all kinds of other things that are especially embarrassing to a full-time web developer. “The cobbler’s children have no shoes” and all that. So I’ve fixed a few things, updated some stuff, added updated social links on the sidebar and generally tidied up a bit.

I’ve thought numerous times about more thoroughly updating the site to be more of a portfolio/museum of work. There’s absolutely tonnes of stuff I’ve done over the years, much of which has just sat on my computer gathering dust. So, watch this space, as I may actually get around to doing something a bit more substantial in that regard.

In the interim, enjoy what’s here, and hopefully have a better time of it on your phone!

0 | Blog

August 8, 2014 - Phaser Isometric plug-in

Recently, as part of my continued work on Archaos (yes, I’m still working on it, never fear!) I put together an isometric (well, axonometric to be a little less precise) renderer for Richard Davey‘s wonderful Phaser HTML5 game development framework. It’s got a nice adjustable axonometric projection helper, a simple and fast physics engine based on Phaser’s own bread-and-butter Arcade Physics, and it’s probably close to production ready. I deliberately kept the system simple, and the API as close to the existing Phaser API as possible to allow for quick adoption, and it plugs in pretty much seamlessly.

You can view the microsite I put together for it here, browse the repo (and maybe even if you feel like it, or spot some of my horrendous and inevitable broken maths, contribute) on GitHub here, view the API docs here, and I’ll also be posting some simple examples to demonstrate the various features shortly. Enjoy!

August 1, 2014 - British Gaming Podcast

I’ve begun appearing on one or two podcasts, the first of which went out on Wednesday. You can watch the full more than 2 hour recording here:

1 | Blog

March 29, 2014 - It’s still alive…

www.archaos.co.uk

More soon…

June 11, 2013 - Ignite100 startup funding

Just a quick one today. I’ve registered with F6S for the chance to get some much needed help in bringing Archaos to you lovely people; and I’d very much appreciate your support just by simply following by clicking the button below:

Follow Lewis Lane on f6s

Don’t worry, I don’t want any money, pledges, DNA etc, just a simple show of support – it really will mean a lot to me, as there’s nothing I want more than to get the chance to be able to make games such as Archaos – games which I feel there really is a dearth of in this age of many shallow social and AAA titles alike.

Whether or not you choose to follow me on there, the fact that you’re reading this already shows that I have an audience, and that’s really important. Thank you so much for your support!

0 | Blog

May 1, 2013 - Financial hiatus

I’m taking a little bit of a break from Archaos at the moment as more immediate priorities have arisen – notably my financial status! As you probably know, I quit my full time job in September of last year to work on Archaos, and indeed I’ve made a lot of progress; as much if not more in my abilities as a programmer as on the game itself.

As it stands, I need to do a partial rewrite on the client, as some aspects of it (mainly legacy stuff from last year) have become unmaintainable. Sounds drastic but I assure you this is only a minor setback; lots of Archaos is done and working to my satisfaction (the server for example is in a pretty good state at the moment, and the implemented features are working very efficiently) however the rigours of dealing with stateful asynchronous stuff all over the place (via the network, player inputs, waiting for animations and so on) combined with the lack of any kind of pattern have led to a game which as it stands is becoming near impossible to debug. Action must be taken, and that will begin with the application of a proper MVC pattern to the client game code.

In order to continue to be able to work on Archaos, I’ve taken on some web jobs (which bizarrely appeared totally out of nowhere from friends right as my savings were about to dry up) but this is a temporary thing and as soon as they’re done, I’ll be back onto Archaos and aiming for a beta release.

I can only apologise for the seemingly endless false starts and broken deadlines for those of you who’re following this project – it’s embarrassing to keep having to explain myself. My focus is however still solidly on getting Archaos finished and released, and then getting to the bit I’ve been really looking forward to; extending the game through new modes, features, spells and units!

Stay tuned!

December 10, 2012 - Why am I here, and what is my purpose?

In the beginning there was nothing, which exploded. Immediately the laws of physics ensured that everything would work the way it does. Without physics, the universe wouldn’t exist and we wouldn’t be able to ask the question. From the physics that cause the stars to shine and eventually die came chemistry. Every element of every molecule in every compound in the universe came from a dying star. The abundance of elements and the laws of chemistry resulted in biology – life. For billions of years physics, chemistry and biology interacted, resulting in all of the people you have known, all the pets you’ve owned, all of the birds you’ve heard sing, and all of the insects you’ve unwittingly stood on.

You’re here because physics, chemistry and biology have been at work shaping energy and matter for 13.75 billion years, and will continue to do so long after you are gone. Your purpose is to enjoy your short waking moment in time, to learn and to explore, and to recognise that you are part of a magnificently ancient, complex and purposeless universe that has produced you with your own complexity and consciousness, and given you the ability to comprehend your place in it and choose your own purpose.

Website and content © 2009–2026 Lewis Lane