Monday, July 04, 2011

More Water Screenshots

Updated the way water works.  I think I'm happy with it now.  So far my logic is like so:

if the water level > 0
 if there's a cube below
  if there's no cube behind
   add water behind
  if there's no cube in front
   add water in frnot
  if there's no cube to the left
   add water to the left
  if there's no cube to the right
   add water to the right
  add water below

If we're adding water below us, we add the water with the same amount of level as before.  If we're adding water anywhere else, we lower its level by 5 so it's not infinite.  The only time it can be infinite is if it were to keep going down nonstop.  Since we have a hard lower limit (higher is infinite still), we're guaranteed to always have some kind of hard stop.

I still haven't found a solution for the ocean that doesn't destroy the CPU.  It's pretty fun to toy with this water though so I'm in no hurry.

No comments: