Games how would you create a blood splatter in game?

sorex

Expert
Licensed User
Longtime User
with just some randomizing math you can get some good splash results but in your example link it's more like a smudge/smear effect.
 

sorex

Expert
Licensed User
Longtime User
here's something I wrote a few years ago (the delay is because it's drawing out of the capture screen it draws instant and animated)

splatter.gif
 

ilan

Expert
Licensed User
Longtime User
here's something I wrote a few years ago (the delay is because it's drawing out of the capture screen it draws instant and animated)

View attachment 83229

Thats really nice. I will do some checks to see how i can implement it using a game engine we have in b4i and b4a
 

sorex

Expert
Licensed User
Longtime User
you can find splash brushes for photoshop aswell maybe you can make a sprite sheet of it and randomly select one.
 

MarkusR

Well-Known Member
Licensed User
Longtime User
i think the best result you can achieve with a particle system.
it is just a list of particles, each paint a small picture
and all are updated each frame in rotation or position.
they will be removed after time or out of screen or if limit is reached the oldest will removed from list.
 

sorex

Expert
Licensed User
Longtime User
the main animated drawing loop is just this, Martin.

B4X:
For x=particles.Size-1 To 0 Step-1
 Dim p As particle
 p=particles.Get(x)
 p.x=p.x + Cos(p.angle) * 4
 p.y=p.y + Sin(p.angle) * 4
 p.size=p.size - Rnd(1,3)
 cvsSplash.DrawCircle(p.x,p.y,p.size,fx.Colors.From32Bit(p.color),True,0)
Next
 

ilan

Expert
Licensed User
Longtime User
the main animated drawing loop is just this, Martin.

B4X:
For x=particles.Size-1 To 0 Step-1
 Dim p As particle
 p=particles.Get(x)
 p.x=p.x + Cos(p.angle) * 4
 p.y=p.y + Sin(p.angle) * 4
 p.size=p.size - Rnd(1,3)
 cvsSplash.DrawCircle(p.x,p.y,p.size,fx.Colors.From32Bit(p.color),True,0)
Next

the question is how the particle object looks like. is it a type object?
can you post a complete project that show how you did that animation. it looks really nice.
 

sorex

Expert
Licensed User
Longtime User
yes, it's just a type and you can see from the source what it contains and that's just x,y,angle,size,color.

the animation is the previously posted code in a timer, that's all.

maybe I'll post a project file later but it's part of an unfinished project.
 
Top