Game Development Reference
In-Depth Information
Generating a random number
You can generate a random number using TScripts:
Random ( maxvalue )
The maxvalue is an integer value of the range of numbers the Random
command will generate. The generated number will be an integer
between zero and the maxvalue - 1.
Example
The X position of the Toon Cheese is set to a random value between 0
and 99.
On NewFrame
Set Property (Cheese, x) = Random (100)
End NewFrame
Subroutines
You can create individual subroutine scripts in TScripts, making your
scripts reusable and more manageable.
Adding a subroutine
1 Click on the Add Sub button in the TScript dialog box.
A subroutine is created and given an indexed name SubN. To rename the
subroutine simply overwrite its default name.
Script that is written between the On SubName and End tags will be run
every time the subroutine is called. A subroutine can be called as many
times as you like from the StartMovie script, another subroutine and
anywhere in the NewFrame script.
Calling a subroutine
Call SubName
Debugging using the Script Window
You can debug your TScripts by writing information to the script window
from within your scripts:
Put argument
Search Nedrilad ::




Custom Search