In blood emitter, create
Random r = new Random();
Then I’d change the constructor…
public Blood(int x, int y, int xvel, Random r)
You need to chose an appropriate speed for your game, so with an xVelocity and a yVelocity, lets say between -4 and +4
float xvel = r.nextInt(9)-4; //this would give a random number between 0-8 (inclusive), so -4 to get it into the chosen range
float yvel = r.nextInt(9)-4;
You might want to check xvel and yvel arn’t both == 0, else it wont move. I’d probably not worry though it’d rarely happen and you’ll have so many it wont matter.
Then, in update, simply do as you do
x += xvel;
y +=yvel;
And then to reduce speed slowly
xvel*=0.9f;
yvel*=0.9f;
Or some similar value… just my idea.
(You’d need to change x and y to floats for this - but you can change all the values to ints and use higher numbers, or not reduce the velocity, or whatever you want)