Hello to everyone
In my game i have ennemies who are spawned/created every 5seconds, i would like to make them JUST to do randoms jumps.
How to tell to the sprites to jump randamly but NOT ALL at the same time??
Develop games in your browser. Powerful, performant & highly capable.
Create a "A" variable to generate random numbers every second, every tick, whatever you prefer.
Create a "B" variable to generate random values.
Create a Instance variable "C" on your enemies that will hold any value.
For each enemy you spawn, set it's stance variable "C" to the value of the variable B.
Then every tick, or every second, or whatever you prefer, compare the values of "C" for each enemy in game. And then set a command to whenever "C" has the same value of "A" simulate the enemy's jump.
You could try putting all the enemies in a Family. If you reference the family in your events, each instance will move individually.
So you could do something like...
Every "random(A, B)" seconds -- EnemyFamily is on screen ----------- EnemyFamily - Y vector "number"
I think that might work.
how to add the enemis to a familly? i don't see that option
I hate being the guy to just link to the manual, but it really explains it well...