I have created a bullet sprite, and I spawn bullets, but on creation I change the speed of the bullet so they can have different speeds.
Howerver, it looks as if I am changing the speed for all bullets of the given class of sprite, and not the instance.
Is this true? Is the bullet behaviour properties "global" for all instances of the sprite?
Try to randomize the speed right before spawning the bullet...I think once created u can't change the speed I guess
1º bullet - set XX speed > Spawn bullet
2 ºBullet - set YY speed > Spawn bullet
the random expression is "random(x,y)". X and Y are the range of numbers that u randomly get
It looks as if you can change the speed of the bullet, but it change the speed of all bullets, or at least it looks that way.
So is it right that if you set the speed of the bullet, it will set the speed for alle visible instances of the bullet?
It can't be right? can it?
Do it and you will realize
It changes speed's object instance only
Here is how i always done it
Ok Thanks guys
Develop games in your browser. Powerful, performant & highly capable.
in a top down shooter, when a spite moves when in line of sight, set bullet speed to random(100,600) makes the sprite speed up and slow down. it doesn't set a constant speed.
is there a way to set a constant rate of speed within a range?