I’m new in MonoGame and I’d like to create a blood splatter effect like this:
but I have no ideas how to do that in MonoGame.
Could you tell me the way I can do it? Thanks.
I see 2 things here… One is the blood splatter, and the other is the ability for blood splatter to cling to certain tiles…
Since you are new to monogame, I would suggest focusing on the blood splatter first, then you can always make some of it stick later on…
While there might be any number of ways to do this, I have found it simple to use clusters of tiny sprites, moving away from a common starting point…
You give each fragment a direction, and modify those directions over time (in small increments) to represent things like gravity… (changing direction TOWARDS the bottom of the screen as they move)
I recommend using white textures, and drawing them as Red… Then all you have to do is draw them in orange for sparks, or brown for dirt… etc…
When watching that video, think of the
surface as a
RenderTarget2D with the
PreserveContents option. It’s definitely not the most efficient way to do it, but it’s the best equivalent to what that tutorial shows.
Can confirm / I agree about the render-target, have done the same for tire tracks in a game… Works like a charm, and pretty easy to do, once you know what a render target is, and how to use it.
Really depends exactly what type of effect you’re going for, I use meta balls for a liquid type effect in the game I’m making (google ‘XNA meta balls’ and you’ll get loads of results).
You can see an example vid on my twitter here: https://twitter.com/SuperSmithBros/status/746445764247818240
I add some basic collision detection to each particle to allow it to bounce off walls.
A simpler way would be to just use a particle effect but it really depends what you’re trying to achieve.