Monday, June 14, 2010

Games for Infants

Games for infants. A noble cause. But they're tricky customers. And in the end, so easy to please.

Once upon a time I thought, "I shall make a game for infants, it shall be easy and quick." So, I thought to myself, what do infants like to do? Whap their grasping tentacles at things. Yes, such as keyboards. And they like it when things do things, but they're not very sophisticated.. so simple reactions should be just fine.

So, I sat down and made a simple program to change the color on the screen when keys were pressed.

Fail.

First, infants seem to like all buttons, especially the windows key, Alt key, etc. All sorts of ways to make an application loose focus. Second, they like to mash buttons. To grind them down. As if pinning the machine and asserting, "I AM YOUR MASTER!"

So, let's see.. easy things first. Holding buttons down can change the color of the screen too. How about a key press causes a flash in green that fades away quickly, and the intensity of blue ramps up the longer you hold keys. Ok, working well, let's try it out. Ah, it works, but again, infant seems rather determined to exit the app, launch new applications, all sorts of not intended things.

Most of a Saturday later, I've learned about windows hooks. How thoughtful of Microsoft to give me a way to catch and handle the key presses before Windows interprets them. I'd like to do this from C# and XNA, so that was a bit of searching and tinkering, but Bnoerj.Winshoked seems to work. Yeah, that works fairly well, gimme your kid again, lemme try.

Fail.

Yup, infants are dutiful testers, seems to reliably mess things up. How much time do I really want to spend on this? Let's try searching the Internet again... nope, nothing really good out there. Hmm, except...

Ah-HA!

Windows log-in screen should do nicely. If anything in windows can stand up to button mashing it'll be the log-in screen. Whap keys, see dots show up, hear beeping noises as the length limit is hit, that should entertain the kiddo. Give that a shot.

Blue screen.

Really? Had to have been a fluke. Try again. See, it works, happy kid. Blue screen.

Hmm.

Well, I've learned something. Why build a game when an infant can be entertained with just the log-in screen. And, how disconcerting is it that sustained mashing of keyboard keys can cause a blue screen?