[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tads3] UnderSurface - Second Thoughts



Mike Roberts wrote:

> If you want to make an object invisible even when the ordinary "sense
> physics" say otherwise, my guess is that the place to do it is the
> object's canBeSensed(). I think HiddenItem could be made to work like
this:

> class HiddenItem: Thing
>    canBeSensed(sense, trans, ambient)
>    {
>      if (sense != sight || discovered)
>         return inherited(sense, trans, ambient);
>      else
>         return nil;
>    }
>    discovered = nil
> ;

I've just tried that and it seems to work fine, although I added an
additional little method to make it compatible with the way I'd modified
Container in accordance with Søren's suggestion (namely discover() {
discovered = true; } ).

> You could leave out the 'sense != sight' test if you wanted the object to
> be hidden for all senses, but presumbly you wouldn't want that. For
example,
> if you had a cell phone hidden beneath a sofa, and it started ringing,
> presumably you'd want it to be audible.

Yes indeed, that's precisely what I envisaged (and likewise for something
giving off a powerful smell), so I think the 'sense != sight' test should
stay.

-- Eric