AddPreload

AddPreload(string folder name, string filename, string filename, ...)

Adds images files to the preload function. It's made to ensure an imagen has been preloaded before show it.

  • string folder name: It's the name of the folder placed in imgs/Sprites
  • string filename (Optional): It's the beginning of the filename placed in imgs/Sprites/Object, where Object is the folder name of the first parameter. You can add as many filenames as you need.
//Variables
var TaoistConversation=new Array("Grandad! wake up.","...","Ying Fing is miss and the vampires are free.","...","I must find Ying Fing, later I will wake up him.");
AddPreload("Grandad","knocked");

//The main function
function Main()
{
    //Title of the Room
    SetTitle("Outside the house");
   
    //Creating Scene and menu
    CreateScreen("outsideright","543,250,587,260,622,398,2,396,1,167,490,171,508,247");
   
    //Adding the player
    CreatePlayer(20,260);
   
    //Persons
    Grandad=CreateObject("Grandad",350,260);
    Grandad.description="Oh my God! my grandad was knocked by the vampires.";
    Grandad.status="knocked";
    Grandad.SetConversation(TaoistConversation);
    Grandad.SetUseAction(GrandadUse);
}

 

Get the latest version here.


It works on: