Have a hankering to look in the opposite direction of the vector you get from Three.js’s .lookAt function? You need .lookAwayFrom! Dunno if there’s an easier way, but the idea is find the vector between the target you’d normally “look at” and you, then add the resultant to your current position, and look at that […]
Author Archives: Mr Speaker
Scala date range
Google it: “Scala date range”. The results are… unhelpful. The top result (a Stack Overflow link, obviously) hints at a workable solution. Here’s my implementation of it: import org.joda.time.{DateTime, Period} def dateRange(from: DateTime, to: DateTime, step: Period): Iterator[DateTime] = Iterator.iterate(from)(_.plus(step)).takeWhile(!_.isAfter(to)) To use it, provide a “from” date, a “to” date and a joda time period: […]
Live editing for game development
Here’s a small demo on how I’ve been using Chrome’s “live editing” features to speed up my development workflow. Chrome let’s you modify currently loaded files on the fly – so you can tweak settings and test code in real time. Don’t forget to keep an eye on the development of my up-and-coming waterski odyssey: […]
Track: Fuck me dead
Just found this weird ol’ track I made a few years ago. Like all my weird ol’ tracks, it was never finished. Now it’s finished.
‘mazed
Maze generation has never been easier: Math.random() < 0.5 ? "/" : "\\"; and you've got yourself a maze! Like all awesome ideas this one comes directly from the Commodore 64.
A better phonetic alphabet
I found this in a txt document that myself & the missus wrote, possibly when drunk, in 2002. Seems important. Aquaman Barometer Chicken Dress-ups Eatery Fedora Goal Posts Heliotrope Irksome Jalepeno Kraftwerk Limp Moisten Nice Oblong Pancake Quincy Restrooms Satay Tanktop Uppity Voltimeter Wafting Xtreme Yurt ZZ Top
What you’re missing out on on App.Net
Maybe you’ve heard that there’s a new kid on the short-message scene: App.Net. It’s just like Twitter, except you have to pay $50 a year to use it. Sure, that’ll keep the poor people away – but what else do you get for the fee? How’s this for an incentive: no longer are you limited […]
CoffeeScript: tell me how you feel about it
[update: wow, amazing response so far! I’ll start collating the data and get you all some findings soon.] Hey chaps, I’m canvasing general opinions and understanding about CoffeeScript as research for an up-n-coming book. There seems to be some pretty strong thoughts on the matter amongst the people I’ve talked to in person, and I’m […]
Nicer random colours, with HSL
As many of you may know from my complaining, I’ve currently embarked on a new writing mission: a CoffeeScript book for SitePoint. The example project that runs throughout is an HTML5 game using Canvas. While I was trying to create a random colour palette – for instructional purposes – I fell over this “trick” of […]