Particle Editor - make line following a player

Anything libgdx related goes here!

Particle Editor - make line following a player

Postby snicer » Tue May 08, 2018 2:05 pm

Hey,

I have some troubles with drawing clear line that is following a player.
At the left side of image its what I want to achieve but on right side is what I currently achieved.

As you can see the dots (of which I make a line) aren't connected properly. I suppose its because my player is moving too fast.
It doesn't metter if I change particle emission per sec - the effect is the same.

Image
snicer
 
Posts: 10
Joined: Tue Mar 27, 2018 9:12 am

Re: Particle Editor - make line following a player

Postby evilentity » Tue May 08, 2018 3:44 pm

If you want a constant line you need to use a mesh. Something like this https://github.com/mattdesl/lwjgl-basic ... nger-Swipe
Looking for a freelancer? PM me!
evilentity
 
Posts: 4250
Joined: Wed Aug 24, 2011 11:37 am

Re: Particle Editor - make line following a player

Postby snicer » Tue May 08, 2018 9:10 pm

Is there no other way to do that using Particles?
snicer
 
Posts: 10
Joined: Tue Mar 27, 2018 9:12 am

Re: Particle Editor - make line following a player

Postby evilentity » Wed May 09, 2018 10:33 am

You could spawn stuff on the line the target made between frames so there are no gaps.
Looking for a freelancer? PM me!
evilentity
 
Posts: 4250
Joined: Wed Aug 24, 2011 11:37 am

Re: Particle Editor - make line following a player

Postby litelitelite » Sat May 12, 2018 6:28 am

From a previous post about "tails" (https://www.badlogicgames.com/forum/viewtopic.php?f=11&t=27132), you can do this with particles, see demo here:
https://youtu.be/zGyeCSmKFUc

Source:
https://github.com/timewasteGames/SpriteWithTail

To get these half decent you need to fiddle with the emission rate, max particles and particle size/shape, all bearing in mind the max speed.

However, I think that this exercise just proved that using particles gives you a trail of particles. Unless you want that, you're much better going with the "finger swipe" approach.
litelitelite
 
Posts: 21
Joined: Sat Jul 15, 2017 9:43 pm

Re: Particle Editor - make line following a player

Postby snicer » Tue May 15, 2018 3:08 pm

evilentity wrote:You could spawn stuff on the line the target made between frames so there are no gaps.


I wanted to loop through every Particles and check if distance between two of them is greater then some value. If true, I would like to spawn new particle between those two.
But as I can see it is neither possible to get particles array nor insert new particle between others.
Am I right its not possible to do so?

I've checked your solutions but neither of them works as I wanted to in my case.
snicer
 
Posts: 10
Joined: Tue Mar 27, 2018 9:12 am

Re: Particle Editor - make line following a player

Postby evilentity » Tue May 15, 2018 6:00 pm

How is a mesh not working? It works exactly as you want, by making a line along certain path.
You wouldnt do that with particle effect, you would do it manually. Spawning a milion sprites is not very efficient way of making a line.
Looking for a freelancer? PM me!
evilentity
 
Posts: 4250
Joined: Wed Aug 24, 2011 11:37 am

Re: Particle Editor - make line following a player

Postby snicer » Wed May 16, 2018 9:56 am

I meant, that I do not always create straight line.
If my player is cosmic ship - I create the line. But if he turns into ex. airplane - the path would be more like more "cloudy".

The same if my player is another vehicle ex. car - I need to spawn 2 tracks. And then it would be much easier to create two tracks in particle editor.
snicer
 
Posts: 10
Joined: Tue Mar 27, 2018 9:12 am

Re: Particle Editor - make line following a player

Postby evilentity » Wed May 16, 2018 10:34 am

So? Its points either way, mesh doesnt care. You can apply whatever texture you want. Do whats appropriate for given task. If you want puffs of dust after a car, use particles.

What difference does it make if you have 1, 2 or 10 wheels? None. You spawn a mesh after each of them.

Pretty sure this game uses meshes, due the way the path bends on tight corners.
https://store.steampowered.com/app/6443 ... s_Lovecar/
Looking for a freelancer? PM me!
evilentity
 
Posts: 4250
Joined: Wed Aug 24, 2011 11:37 am


Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest