Array of Actors?


Hectate

  • *
  • Posts: 4645
Something like this works if you're just adding all of them from a scene right at the start. The do-after is recommended because sometimes the code for the behavior is run before the actors are created, IIRC. Waiting a fraction of a second after the scene gets built means you can delay checking for actors and ensure they're all in-scene and ready to be detected.
Code: [Select]
When Created
set MyList to New List
Do After .1 Seconds
- For each actor of type MyType
-- Add Actor Of Type to MyList

Alternatively, if you're doing something like creating projectiles or waves of enemies, just add then when you create them.
Code: [Select]
Create actor of type Enemy at...
Add [Last Created Actor] to MyList
// do stuff with your list of Actors later...
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

mika3394

  • Posts: 18

« Last Edit: October 25, 2016, 06:23:49 am by mika3394 »

Hectate

  • *
  • Posts: 4645
пожалуйста
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.