Question
Adventure game engine: a couple of issues
I'm making an adventure game for a uni course and I'm having
a few issues with building the interface:
---------------
1. I'm not able to have multiple hotspots at the same time, because of a declaration conflict.
I have a boolean variable in the root timeline, called onHotspot that is meant to track if the mouse is currently on any of the hotspots. Each hotspot movieClip has it's own hitTest (in onEnterFrame), which sets the onHotspot variable to True, when the mouse is over it. The problem is how and where to set the variable to False, whenever the mouse isn't on a hotspot.
If I have the False set in each of the movieClips in an if-else statement (if onHotspot=true {do something}, else onHotspot=false), it naturally forces the variable to False, even if the mouse is on a hotspot. So, basically I need the onHotspot to be globally available to any interactions, but I'm having trouble controlling it, because there are multiple hotspots.
What's the best way to change the onHotspot variable to False whenever the mouse is NOT on any of the hotspots?
---------------
2. Is there any way of freezing all interactions within the flash movie except a specific one?
I have an inventory box that appears on top of the game scene when the inventory button is pressed. I need all of the scene interactions to be unavailable while the inventory is visible. Currently, whenever the inventory is open, you can still control the character in the background and interact with the scene hotspots. I want it so that everything in the background becomes frozen and unusable when the inventory is open, and when the inventory is closed, everything returns to normal.
How do I freeze the background while the inventory box is open?
---------------
Thanks in advance :D! I'm really stumped with these two issues.
---------------
1. I'm not able to have multiple hotspots at the same time, because of a declaration conflict.
I have a boolean variable in the root timeline, called onHotspot that is meant to track if the mouse is currently on any of the hotspots. Each hotspot movieClip has it's own hitTest (in onEnterFrame), which sets the onHotspot variable to True, when the mouse is over it. The problem is how and where to set the variable to False, whenever the mouse isn't on a hotspot.
If I have the False set in each of the movieClips in an if-else statement (if onHotspot=true {do something}, else onHotspot=false), it naturally forces the variable to False, even if the mouse is on a hotspot. So, basically I need the onHotspot to be globally available to any interactions, but I'm having trouble controlling it, because there are multiple hotspots.
What's the best way to change the onHotspot variable to False whenever the mouse is NOT on any of the hotspots?
---------------
2. Is there any way of freezing all interactions within the flash movie except a specific one?
I have an inventory box that appears on top of the game scene when the inventory button is pressed. I need all of the scene interactions to be unavailable while the inventory is visible. Currently, whenever the inventory is open, you can still control the character in the background and interact with the scene hotspots. I want it so that everything in the background becomes frozen and unusable when the inventory is open, and when the inventory is closed, everything returns to normal.
How do I freeze the background while the inventory box is open?
---------------
Thanks in advance :D! I'm really stumped with these two issues.