dougmencken / HeadOverHeels

The free and open source remake of the game “Head over Heels”
GNU General Public License v3.0
33 stars 10 forks source link

these three gotchas with swopping characters #27

Open dougmencken opened 6 years ago

dougmencken commented 6 years ago

Let the joined Head over Heels character stay below an elevator, wait when elevator lowers on top of character, then swap, swap, ... Magically, Head is on top of an elevator

head goes on elevation via swapping

Get funny BANG somehow related to FallKindOfActivity::assignAnchor~ when one of two characters in the same room is active and is under some door, then just swap ’em

When inactive character of two in the same room meets mortal item it turns into bubbles... Until swapping. And when active one dies too, that other would be lost forever. Maybe activate him in cases of meeting something mortal?

inactive dies

dougmencken commented 6 years ago

Yet it activates, and room restarts

one

inactive character head @ safari4.xml is going to vanish, activate it

@@ -404,6 +405,12 @@ void UserControlled::collideWithMortalItem( PlayerItem* player )
                         break;

                 case Vanish:
+                        if ( ! player->isActiveCharacter() )
+                        {
+                                std::cout << "inactive " << player->getUniqueName() << " is going to vanish, activate it" << std::endl ;
+                                player->getMediator()->pickNextCharacter( nilPointer );
+                        }
+
                         // animate item, restart room when animation finishes
                         if ( player->animate() )
                         {
dougmencken commented 6 years ago

“funny BANG” inside FallKindOfActivity::assignAnchor is just missing checks for nil

if ( itemBelow != nilPointer && anchor != nilPointer )

before doing things like

if ( itemBelow->whichKindOfItem() == "grid item" && anchor->whichKindOfItem() != "grid item" )
if ( ! itemBelow->isMortal() )
if ( anchor->isMortal() )
if ( anchor->getX() + anchor->getY() < itemBelow->getX() + itemBelow->getY() )
dougmencken commented 6 years ago

Yet there’s just one “Let joined Head over Heels character stay below elevator, wait when elevator lowers on top of character, then swap, swap, ... Magically, Head is on top of elevator” to fix