mbkarle / mind-the-fog

Roguelike JavaScript game--mind the fog!
2 stars 1 forks source link

Doge fog issues #91

Closed akarle closed 7 years ago

akarle commented 7 years ago
  1. Go to any floor with fog
  2. Run through the dog and then turn around and run back through the dog. Notice two things:

    1. when you stop and wait for the fog to return, the dog becomes shrouded in fog. this is likely because the dog has a fog_timeout that does not get cleared properly? or the location under the dog has a fog_timeout set ON THE HTMLID that the dog now resides in, but this fog_timeout is not cleared bc the dog is 'sitting' on it and absorbs the clearTimeouts.
    2. The spot where the dog is pushed aside to will NOT HAVE ITS FOG READDED. Possible here is that we put the fog readd on the dog instead of the location underneath

    COUNTERMEASURE/NEXT STEPS:

    • when clearing a fog timeout for a dog, clear the timeout for the spot under it instead.
    • when adding fog timeout for a dog, add it to the spot underneath instead
akarle commented 7 years ago

This was fixed!! It was a simple, elegant solution. Basically, a new class Dog.js was introduced, and a new property "dog_present" was added to location.

Dog's should never have their own fog, in fact, they don't NEED to be a location. The only reason I pinned them as a location before was so that I could interact with them, but this is easily fixed by simply making the interact with a tile call interact with dog if a dog is present