(BitzPlus)
What's the point of giving a name to types?
First, I thought I could use them to build a structure and then create differetn instances... But this is not true.
The For... Each loop will check all instances regardless of the name... Is it normal?
Example:
This will print both cats and zombies...
And if you try a new name:
It will print all sprite collection again!
I have already found workarounds for this, but don't you think that it is not logic? Each instance of a type should be a different collection.
What's the point of giving a name to types?
First, I thought I could use them to build a structure and then create differetn instances... But this is not true.
The For... Each loop will check all instances regardless of the name... Is it normal?
Example:
Type SPRITE Field LOCX Field LOCY Field CURRENTFRAME Field MAXFRAME End Type For temp = 1 To 20 cats.sprite = New sprite cats\LOCX = Rand(100) cats\LOCY = Rand(200) cats\CURRENTFRAME= Rand(1,8)-1 cats\MAXFRAME= 8 Next For temp = 1 To 20 zombies.sprite = New sprite zombies\LOCX = Rand(100) zombies\LOCY = Rand(200) zombies\CURRENTFRAME= Rand(1,18)-1 zombies\MAXFRAME= 18 Next For zombies.sprite= Each sprite Print zombies\LOCY Next
This will print both cats and zombies...
And if you try a new name:
For zombies.sprite= Each sprite Print zombies\LOCY Next
It will print all sprite collection again!
I have already found workarounds for this, but don't you think that it is not logic? Each instance of a type should be a different collection.