Cmd-Z in Safari

I just closed a tab in Safari on my MacBook and just out of idle curiosity tried ⌘-Z (the default Mac keystroke for “undo”). To my complete surprise and delight, Safari reopened the tab I just closed. Even better, history is preserved when you undo.

I’ve just started mucking around with Unity too, and there are a couple of keyboard shortcuts you should be aware of in the Mac version that I find time-saving. The first is ⌘-P to play the current scene. The other is ⌘-Backspace to delete an object.

Finally, if the cursor keys are a bit of a reach for you, then I discovered this useful list of emacs-based keyboard shortcuts that can be used in any Mac OS X text field. I find Ctrl-A and Ctrl-E particularly useful.

MacBooks and Auto WiFi Depending on Ethernet Availability Using Keyboard Maestro

When I connect an Ethernet cable to my MacBook, WiFi is automatically disabled. When I disconnect the Ethernet cable, WiFi is enabled again. This not standard behaviour. It seems like magic. so how did I do it?

Brett Terpstra recently posted a tip on how to turn a Mac’s WiFi on and off from the shell[1]. I remembered that Keyboard Maestro recently added functionality to allow the triggering of a script when a volume was mounted or unmounted[2].

Well, what does a volume mount have to do with an ethernet cable connection? I only “dock”[3] my MacBook to a USB extender, power and Ethernet. Whenever I plug in the USB extender, my media and backup drives become available. Sometimes I might disconnect my backup drive, but whenever I’m “docked”, my media drive entitled amazingly enough, “Media” is always connected.

So I set up a Volume mounted trigger on “Media” and this executed the following shell script, taken straight from Terpstra’s article:

networksetup -setairportpower en0 off

And I set up a corresponding shell script trigger for when “Media” is unmounted as follows:

networksetup -setairportpower en0 on

Voilà! I no longer have to manually turn WiFi off to take advantage of lightning fast Ethernet speeds when I’m plugged into my BT Infinity 2 router over the Gigabit Ethernet, and I no longer have to remember to enable WiFi when I unplug.

  1. “Quick Tip: Automating your Mac’s wifi power”  ↩
  2. “Major Changes for 6.0”  ↩
  3. I ordered a Zendock a lifetime ago on Kickstarter. They seem like nice people, but it’s been a very long time.  ↩

Reach for the PC

Screen Shot 2014 02 22 at 20 18 45

Finally then, here is the PC build of Reach for the Sky, my toy, soon to be I think, the world’s first Rocket RPG. Yes, that’s grandiose. Yes, that’s tongue in cheek. Oh and there is a Mac version too. Of course. And the Mac version has that lovely rocket sound.

Get the PC build here.

Get the Mac build here.

Remember, it’s just a toy, so muck around with it. I’ll be building a game on top of it.

You can fiddle with the JSON files in the assets folder and see what happens. The good news is that you can fiddle with them without restarting the game. After you’ve fiddled, just hit the Backspace (delete on Mac) key and all the changes will be reloaded.

You can change the sky gradients, the engine power, the atmospheric density at ground and at the top of the sky, the drag on the ship, and lots more. Please give me comments here, or on Twitter @shahidkamal with the hashtag #RFTS

Thanks to everyone for your help so far!

Reach for the Sky – update 1

Screen Shot 2014 02 16 at 19 43 50
I’ve done a weekend of work on this, but almost none of it is visible.

Internally, this is not just a toy now. I can play with the environment, background, rocket attributes, physics, engines and so on very easily. Instead of a single big file, I have classes for Ship, Engine, World, View, Particle, Emitter, RocketEmitter and so on.

This is the latest Mac build, watch out, this rocket is a lot more powerful. The gradient sky came about as a result of a nice tip from Paul Pridham (@madgarden on Twitter) – thanks Paul! I will experiment with this in later builds. The gradients are important because the object of the game will be to ensure that you reach the “sky” (the dark bit) and of course, the sky will become a narrower band as the levels progress.

Next week, there will be levels and more than one rocket to control. Eventually, you’ll be able to level up your rockets with multiple staged engines, but it will become like playing the keyboard, so later levels won’t be easy. You might need a friend when it gets up to 8 rockets on the screen with each of them having different attributes!

Download for the Mac here.

Sorry I haven’t got a PC build ready. I’ve not had time to build the Cinder environment for my PC laptop yet.

Reach For The Sky

This is a toy that took me a weekend and a bit to get going. I’m using the Cinder library, which for the most part keeps itself to itself, and C++, very badly abused C++ at that.

It’s only on the Mac at the moment. I’ll see if I can get it going on the PC and upload a build here if I can.

Grab the Mac build here.

Unzip it, stick it in Applications or something and remember to sort out your security settings to allow running something by a nobody. (After you’ve run it, do remember to restore your security settings, OK?)

Red Tape

Modern technology was supposed to make our lives easier, but much of it reminds me of the worst excesses of cold war Eastern bloc bureaucracy.

Take TexturePacker for example. It’s not the worst offender by any means, and I feel a little mean picking on a program developed by an independent developer, but I am a customer, and I did part with money. I bought this program in October 2012 after it came highly recommended by I think Steffen Itterheim of cocos2d tutorial fame. I have yet to use it.

This morning I wanted to use a little time to migrate Alphabite code from Cinder, which is clean, powerful, transparent and utterly amazing, to cocos2d-x, which is easy to use, has great tools support, but is perhaps a little more opaque and so harder to fix when things go wrong. From being able to draw sprites individually, I needed to be able to draw them from a sprite sheet. You don’t have to, but I thought I might as well get it right from the start.

I remembered buying TexturePacker. I like buying software tools, even those, like TexturePacker, I don’t use. It’s the digital equivalent of a well-stocked tool shed. Sometimes, a man just wants to peruse his amazing collection of unsullied SnapOn metal and not necessarily ever get around to building that armoire, or customising that chopper, but it’s good to know that should the occasion demand it, he’d have the tools to do it.

Similarly, I like to kid myself that I can still program. Chimera is not exactly the greatest achievement, but it makes me think that should it come down to it, if my country ever needed my programming ability, I’d be ready to deliver; and I’d have the tools to deliver with.

Except that the tools that I buy are digital. I downloaded TexturePacker again, and activated it. Or at least, I tried to activate it. I was met with a message informing me that I was outside my update period, whatever that meant, and that I wouldn’t be able to use it. Not to mention it features the stupidest clip art I’ve ever seen.Screen Shot 2013 04 26 at 06 44 44

My tool wasn’t in my shed of course. I’d changed my Mac, so I was redownloading the tool. Imagine my set of shiny tools actually live in the SnapOn van and I have to pay to use the latest tool, or I have to find the original van that had the tool I paid for in the first place.

Except that I can’t find the original SnapOn van. And I can’t find the version of TexturePacker that I paid for on the site.

Now you can see why people like the Mac App Store. And why I’ll be using SpriteHelper. Which incidentally, I also bought ages ago and never used. It was ugly. I don’t like ugly tools. I like shiny. TexturePacker was shinier. Except for that clip art. But at least I know where to go to download SpriteHelper and I know I won’t have to pay any more than I did in the first place.


Kraftwerk taught me how to count to acht in German. They also taught me how to count to four in Spanish, but I prefer their German accents. I was young. I had never really taken an interest in German before. In 1970s Britain, we were raised in a culture of gloating over victory in World War II, probably because we were still smarting from the recent football defeats inflicted on England by Franz “Der Kaiser” Beckenbauer and Gerd Müller. Suddenly as I started to explore identity in my my mid-teens, I found myself liking Germans, and I’ve liked them ever since. I feel an affinity towards the language, and long to be good at it. Those who find it harsh don’t hear its rhythm, its syncopation, its precision and probing. Like Kraftwerk in fact.

I loved Kraftwerk when it wasn’t particularly cool to love them. I loved them in the late 1970s and early 1980s. I played their meisterwerk continuously as I made Chimera. Looking back, there couldn’t have been a more appropriate album to write Chimera to.

We regret those things we do not do, and hopefully, not too many of the things we have done. I regret not having taken the opportunity to see Kraftwek at the Tate Modern. If you were one of those people who planned their life well enough to accommodate a live show that features one of the most prophetic “bands” in pop history, my hats off to you.

If you don’t ache listening to Computer Love (and you can tolerate the Coldplay desecration), then you probably don’t remember a time before Facebook, or a time before compact discs and mobile phones. Yes, there was such a time.