SearchParameter(string text)
It search a text and returns a value, true or false.
//Add additional images to the preload
AddPreload("Key");
AddPreload("Paper");
AddPreload("Spell");
AddPreload("TaoistSword");
//The main function
function Main()
{
//Title of the Room
SetTitle("Bedroom");
//Image background and walkable area
CreateScreen("bedroom","107,207,246,207,257,192,511,194,518,209,648,212,656,193,690,193,788,393,15,393,107,207");
//Adding the player
CreatePlayer(620,190);
//-Door
DoorGym=CreateInvisibleObject("257,21,499,20,500,184,259,181");
DoorGym.description="The Door to the gym, it's locked from the other side.";
if(!SearchParameter("BedroomDoorOpen"))
{
DoorGym.use=DoorGym.look;
}else{
DoorGym.DoorTo("gym",350,280);
}
//-Window
Window=CreateInvisibleObject("52,182,33,164,24,116,35,67,58,44,71,62,76,92,75,129,67,161");
Window.description="Window to the outside.";
if(SearchParameter("WindowOpen"))
{
Window.DoorTo("outsideleft",640,75);
}else{
Window.description+="It's closed with key.";
Window.use=WindowClosed;
Window.UsableWith("Key",OpenWindow);
}
}
Get the latest version here.