if you wanted to make a type called "baddie":
and then to make a few new instances of the type you can say:
this makes a list of 10 instances of the type baddie, with random values for each attribute.
so now youve made a list of types. to cycle through each of them:
to access the first one of the list:
to access the last one in the list:
to access the third one in the list
neil
type baddie ; this declares the type field xpos# field ypos# field speed% ; these are the attributes that each instance of the type will have end type
and then to make a few new instances of the type you can say:
for i = 1 to 10 anythingyoulike.baddie = new baddie anythingyoulike\xpos = rnd(1,200) anythingyoulike\ypos = rnd(0.1,10.333) anythingyoulike\speed = rnd(1,55) next
this makes a list of 10 instances of the type baddie, with random values for each attribute.
so now youve made a list of types. to cycle through each of them:
for john.baddie = each baddie john\ypos = john\ypos+10 ; moves each instance down 10 pixels next
to access the first one of the list:
fred.baddie = first baddie
to access the last one in the list:
beatrice.baddie = last baddie
to access the third one in the list
jemima.baddie = first baddie jemima.baddie = next baddie jemima.baddie = next baddie
neil