### Creating behavior ( patterns spawn ) Help

#### ElGamer

• Posts: 11
I am creating a game and want the enemies appear randomly but then I came up with the idea of ​​creating a running behavior patterns ...

the real question this can be done in stencyl or other limitation ? ... and if they could make could show me an example?

#### KramerGames

• Posts: 405
What exactly do you mean? Like have them run mostly in the same way with a bit randomization? If yes, should be fairly easy. Such as

when created
set x-speed to 20+(random number between 1 and 10)
do after (random number between 3 and 5) seconds
set x-speed to 20+ random number

And then add a loop somewhere

By coincidence I was just reading about random floats, which are (apparently) random numbers but much more precise with a lot of decimals.

There is a tutorial on youtube called "enemy behavior in stencyl" where the speed of the actors is randomized when they are created and when they hit a wall.
Parasites United  (Idle Parasite Game)

#### ElGamer

• Posts: 11
Well, I already knew that what I say is that behavior actors appear in a specific order =

This is an example

a line of actors,
a diagonal of actors,
column actors

something ... you know those old games airplanes or ships where aparecian different aircraft in a sequence ( a pattern ) well that's what I want to do but ... without creating a long map that the actor has to go .. .. maybe I did not explain well , I'll tell you an idea

Imagine a fixed screen and you have to defend the party is on your left side in this case ... and enemies out on the right side but in sequence ( pattern)
for example = 1 enemy , 2 enemies , 3 nTo enemies and so they are a lot and need to use power ups

besides the enemies do not come out haphazardly as in this picture

http://imgur.com/6v4IlTY

http://imgur.com/6v4IlTY

#### KramerGames

• Posts: 405
Still not 100 sure what you mean...
You want the number of enemies spawning to increase?
You want them fly in formation or spawn in formation?

For the flying in formation you could use events and triggers. Have the plane that is on the bottom have that random behavior as mentioned above, and everytime it changes, it triggers an event that does the same change to the other planes. Would look pretty cool if it is delayed by like half a second in each plane. But maybe you meant something else...
Parasites United  (Idle Parasite Game)

#### ElGamer

• Posts: 11
If That's just what I mean, I want to fly in formation ... always walk in formation, what I want is an example of behavior to perfect