Art is Art and Water is Water

February 28, 2010

February Game: PyCross

Filed under: Arduino, Month Games — foone @ 10:05 pm

Yes, the lamest month game since I made a Bejeweled clone, it’s PyCross! (Hey, now that I think about it, Bejeweled is kinda like one-player naughts-and-crosses/tic-tac-toe with gravity and colors)
It's naughts and crosses

This was actually February game attempt 2, my first one was electronics and a microcontroller, I was trying to make a Simon game. I ran into some hardware issues (fried one too many LEDs) and then ran out of time. So my second choice was a simple game, just so I can say I at least didn’t fail at making a February game 🙂

It’s pretty simple, and the most interesting part is the AI (if you can call it that). It is pretty simple:

  1. Can I win this turn? If so, make that move.
  2. Could the player win next turn? If so, block them.
  3. Can I start making a line that’s not yet blocked? If so, start on that.
  4. We’re screwed, so pick something randomly.

Good thing it’s still February here, because I just realized a bug in step 3 that could lead to an invalid move. Fixed!

Advertisements

November 1, 2009

Project: Zelda Door

Filed under: Arduino — foone @ 2:25 am

Someone on tumblr said that they love this theme and that it should play whenever they enter their house.

Since it’s Halloween and I had a microcontroller handy, I made it happen.

Technical type details:

The Arduino is running a minor variant of the Debounce tutorial, with serial status writing added. On the laptop there’s a simple python script that waits for the serial status to show that the door has been open for 1/5th of a second, and then it runs an external command. I set the external command to “playsound zelda_oot_house.mp3”, so it plays the House theme (and not the Massive Attack one).

The biggest design problem I had was that the frame of the door is metal, so there’s always connectivity between the two halves of the security lock, even when the door is open. I had to rewrite it halfway through to detect the change in resistance (since the door open is about 600ohms and closed is about 1). It would have been nice to know that ahead of time, I really should have checked with my multimeter before wiring it up.

Blog at WordPress.com.