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.

Witness Testimony