Friday, July 22, 2005

sticky corners and edges

I wonder who is hitting more walls: me, or the paranoids. The code pretty much works, except I found out that it isn't the walls that are sticky--it's the edges and corners. I've tried tweaking the code, to no avail. I'm going to need to rework a fairly large piece of it. The problem is that I don't exactly know how I want it to do what I need it to do.

If the paranoid is on one wall, then I check the coordinates to find which wall and set the normal vector accordingly. But if it is on an edge, then it is essentially on two walls at once. And if it is on a corner, then it is on three walls at once. What needs to happen is for the vector update function to run for each wall, using the resulting vector from the previous wall as the vector for the next wall. For example, say the paranoid is sitting on walls x, y, and z. Its coordinates would be (x, y, z). The function would need to look at the x and update the vector (V) to V'. Then, the function would need to look at y and update V' to V''. Then the function would need to look at z and update V'' to V'''. If the critter was only on walls x and z, (x, n, z) then the function would need to look at x and update it from V to V', then look at n and see that it is ok, then look at z and update it from V' to V''.

I'm going to need some kind of recursive thing. You know what is really funny? I'm spending so much time on something that the parasites don't even do. sigh. It's certainly good practice though, and it needs to be done so that the program can work until what they really do can be programmed in.

I also need to figure out how I can get the set of functions to repeat through a list a given number of times.

This all could take quite a while. Two work-weeks left. And a presentation on this that needs writing.

0 Comments:

Post a Comment

<< Home