Tuesday, March 25, 2008

On Spencer's Zelda

So basically, Spencer showed me some of his code one night for his Zelda APP. I was just blown away by how "unconventional" it was.

He used lots of calls and complex data structures, yet everything runs extremely fast! What amazed me the most was his use of a list structure to handle enemy behavior within frames.
action_ctm:
.db 255
.dw action_step1
.db 25
.dw action_step2
.db 30
.dw action_cooldown
.db 0
.dw action_ctm

So basically, the .db's in the middle are frame counters, which get moved to a piece of RAM and count down. When the counter hit's zero, a new action handler address is moved to another piece of static RAM. Eventually, it will loop back to the beginning and start again.

Using this idea, he told me to write code for a trigger trap, which was kind of fun. I wish I still had the screenshot, but I'm sure Spencer would have rather had it kept secret. Still, his coding design is absolutely amazing!

Tuesday, March 11, 2008

Convoluted Code

Ever notice how extremely esoteric code can be if you try to make it that way? I was thinking about it when I was doing some Java exercises. It's amazing how much you can compress into a single line (not multiple statements, I mean a single line ending in ";").

Revsoft had a good thread on convoluted code, especially for C. Those guys seem to be doing a lot of work in C to help members of the TI community. Spencer's still got Zelda though. It'll definitely be a smash hit when it gets released.

Monday, March 10, 2008

"Hello World!"

"Hello World!"

First post on this blog.