Post by boowho on Jan 9, 2017 1:26:04 GMT
Where is the reference documentation for this code located?
For example, FlakeDetails[0].Sprite.Y...... The FlakeDetails is obviously a user defined object, but where are the methods, etc of that object defined?? This code is from one of the demos by Hippany called Snow Globe. I couldn't find any other code within the project where the object structure could be defined. So where is it??
Please help if you can.
Boowoho
------------------------------------------------------------------------------------------------------------------------
Timer+=TimeChange; //Increase the time by the amount of time that has changed since the last update.
if(Timer>2){ //When the time reaches 2 frames, create a new Flake.
Timer=0; //Reset the time.
DuplicateCount++; //Increase the script id
var NewFlake=ItemDuplicate("MainFlake","Flake"+DuplicateCount); //create a new Flake with a new script id.
var NewFlakeDetails=CreateFlakeDetails("Flake"+DuplicateCount,NewFlake); //create new details.
FlakeDetails.push(NewFlakeDetails); //add the new details to the details array.
if(FlakeDetails[0].Sprite.Y>(GetMovieHeight()+20)){ //if the first flake in the list goes off the bottom of the movie, delete it.
var OldDetails=FlakeDetails.shift(); //remove the first details from the details array
ItemDelete(OldDetails.ScriptId); //delete the Flake
}
}
for(var i=0;i<FlakeDetails.length;i++){ //Loop through the array of Flakes.
FlakeDetails.Sprite.X+=FlakeDetails.VelocityX*TimeChange; //Move the Flake using the velocity and the amount of time that has changed since the last update.
FlakeDetails.Sprite.Y+=FlakeDetails.VelocityY*TimeChange;
FlakeDetails.Sprite.Angle+=FlakeDetails.VelocityAngle*TimeChange; //Rotate the Flake
}
For example, FlakeDetails[0].Sprite.Y...... The FlakeDetails is obviously a user defined object, but where are the methods, etc of that object defined?? This code is from one of the demos by Hippany called Snow Globe. I couldn't find any other code within the project where the object structure could be defined. So where is it??
Please help if you can.
Boowoho
------------------------------------------------------------------------------------------------------------------------
Timer+=TimeChange; //Increase the time by the amount of time that has changed since the last update.
if(Timer>2){ //When the time reaches 2 frames, create a new Flake.
Timer=0; //Reset the time.
DuplicateCount++; //Increase the script id
var NewFlake=ItemDuplicate("MainFlake","Flake"+DuplicateCount); //create a new Flake with a new script id.
var NewFlakeDetails=CreateFlakeDetails("Flake"+DuplicateCount,NewFlake); //create new details.
FlakeDetails.push(NewFlakeDetails); //add the new details to the details array.
if(FlakeDetails[0].Sprite.Y>(GetMovieHeight()+20)){ //if the first flake in the list goes off the bottom of the movie, delete it.
var OldDetails=FlakeDetails.shift(); //remove the first details from the details array
ItemDelete(OldDetails.ScriptId); //delete the Flake
}
}
for(var i=0;i<FlakeDetails.length;i++){ //Loop through the array of Flakes.
FlakeDetails.Sprite.X+=FlakeDetails.VelocityX*TimeChange; //Move the Flake using the velocity and the amount of time that has changed since the last update.
FlakeDetails.Sprite.Y+=FlakeDetails.VelocityY*TimeChange;
FlakeDetails.Sprite.Angle+=FlakeDetails.VelocityAngle*TimeChange; //Rotate the Flake
}