Thank you for visiting Blazing Games

Listening to the Inventory

The coding work for this episode is fairly simple. We start of by getting the inventory working. The inventory simply shows a glass if the hasGlass flag is set so the code to get the glass is fairly simple. The visibility of the glass in the main movie frame is controlled by setting _visible to the inverse of the hasGlass flag.

function getGlass()
{
hasGlass = true;
inv_movie.updateInventory();
gotoAndPlay("mainRoom");
}

Each of the doors is handled pretty much the same way. The inventory status is checked to see if the glass is being used on the door. If it is then the appropriate listening message is displayed. The message text has been removed from these code samples as the text is rather long and not entirely relevant. If the glass is not being used, the game assumes the player is walking through the door and goes to the appropriate scene.

function toOutside()
{
var imode = inv_movie.getInventoryMode();

if (imode == INV26_NORMAL)
gotoAndPlay("outside");
else {
converseSetText("XXXXXOUTSIDEXXXXX");
converseAddBubble("It appears the crooks are outside this door", CON26_HIDE);
converseStart();
}
}

function toOffice()
{
var imode = inv_movie.getInventoryMode();

if (imode == INV26_NORMAL)
gotoAndPlay("office");
else {
converseSetText("XXXXXOFFICEXXXXX");
converseAddBubble("It appears this door leads to Jack", CON26_HIDE);
converseStart();
}
}

function toBathroom()
{
var imode = inv_movie.getInventoryMode();

if (imode == INV26_NORMAL)
gotoAndPlay("bathroom");
else {
converseSetText("...");
converseAddBubble("I can't hear anything behind this door", CON26_HIDE);
converseStart();
}
}

function toMain()
{
var imode = inv_movie.getInventoryMode();

if (imode == INV26_NORMAL)
gotoAndPlay("mainRoom");
else {
converseSetText("...");
converseAddBubble("The room I just came from seems to be empty now");
converseStart();
}
}

Previous page
Chapter 26 Page 4

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2008 Blazing Games Inc. All Rights Reserved