February 2008

creature.name = ‘Neo’

A huge feature I’d always meant to include in Zyps but had thus far left out: bullet time. On a whim today, I tried adding it, and it took all of 2 minutes…

class Clock
	def initialize
		@@speed = 1
		reset_elapsed_time
	end
...
	#Returns the time in (fractional) seconds since this method was last called (or on the first call, time since the Clock was created).
	def elapsed_time
		time = Time.new.to_f
		elapsed_time = time - @last_check_time
		@last_check_time = time
		elapsed_time * @@speed
	end
...
	#Speed at which all Clocks are operating.
	def Clock.speed; @@speed; end
	#Set speed at which all Clocks will operate.
	#1 is real-time, 2 is double speed, 0 is paused.
	def Clock.speed=(value); @@speed = value; end

So far it seems to Just Work, but I have a lot of unit testing ahead before I’ll declare that with confidence.

One other enhancement I may try is the ability to set a Clock instance’s speed in addition to the global speed. So you could pick up a power-up and suddenly be moving twice as fast as your environment or some such.

Ruby
Zyps

Comments (0)

Permalink

Humorous Pictures
Enter the ICHC online Poker Cats Contest!

general

Comments (0)

Permalink

Die, die, die!!!!

Presenting ShootAction:

shootaction.png

Continue Reading »

general

Comments (0)

Permalink

coerce()

Wow.

Normally, Vector expects its pitch to be a floating point number, or some kind of number. Well, how powerful would it be if I could say this:

object.vector.pitch = RandomValue.new(360)

…and have RandomValue present itself as a different random number each time it’s accessed?

Turns out I can:
Continue Reading »

Ruby
Zyps

Comments (0)

Permalink

…2008, Zyps Contributors.

Zyps has a (hopefully) regular contributor! He just submitted an ExplodeAction with unit tests. (I didn’t even have to ask for ‘em.) And the Environment#<< method he came up with is so convenient (it takes any argument, then calls the appropriate accessor) that I could slap my forehead for not having thought of it myself.

Next he's gonna tackle either a new generic View, or a domain-specific language for Environment setup, wherever his interest takes him. This guy knows what he's doing, so I'll just let him at it.

Edit: Ergh, but he uses double-space characters instead of tabs for indentation. I take all that praise back. :)

general

Comments (0)

Permalink

Wow. Git on Windows is janky and scary right now.

Wired had that article eons ago with a fictitious letter from Linus Torvalds to Bill Gates, hashing out some issues arising from a version of Windows that ran on top of Linux. I would really, really like to see that come true.

development

Comments (0)

Permalink

rSpec cheat sheet…

Here’s a cheat sheet on rSpec with almost completely raw formatting… I’ll HTMLify it if anyone’s interested.
Continue Reading »

general

Comments (0)

Permalink

I’m probably not the first to make this joke, but…

i has can cheeseburger.

general

Comments (0)

Permalink

Someone was doing a demo at the Ruby users’ group on their MacBook, and a transparent notification popped up that their Website was inaccessible. I didn’t know what app was responsible until just now:

Growl (software) - Wikipedia, the free encyclopedia
“Growl is a global notifications system for the Mac OS X operating system. Applications can use Growl to display small notifications about events which the user deems important, in a consistent manner.”
Growl (software) - Wikipedia, the free encyclopedia

I’m watching Jeffrey Grosenbach’s screencast on rSpec, and he’s got Autotest (which watches a directory for file changes and automatically runs the appropriate tests) hooked into Growl. He writes a test, saves it, and boom - a frowny-face immediately appears at the bottom of the screen with the failing test. No further effort required. He updates the source code, saves it, boom - smiley face showing the test now passes. No further effort required.

Ruby in general keeps the feedback loop very tight like this (I’m thinking here of Rails’ ability to modify an app while it’s running). Ultimately this is going to produce better coders, faster.

Hmmm, now I’m imagining a Zyps setup that kills the old interpreter and runs a new one every time you save an environment setup…

Ruby
Zyps
testing

Comments (0)

Permalink

mindless dogma

Humorous Pictures
Enter the ICHC online Poker Cats Contest!

(Ad link grudgingly included out of respect for the awesome ICHCB team.)

general

Comments (0)

Permalink