Particles

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Particles

Post by darkfrei »

Small project about particles, that can attract and repel each other. Based on the Gravity, but here is more complex rules.

Yes, it looks like some fishes.
Attachments
2020-11-14T23_41_01-Particles v1.01.png
2020-11-14T23_41_01-Particles v1.01.png (56.2 KiB) Viewed 7262 times
2020-11-14T23_41_02-Particles v1.01.png
2020-11-14T23_41_02-Particles v1.01.png (50.08 KiB) Viewed 7262 times
particles-1-01.love
(1.86 KiB) Downloaded 290 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: Particles

Post by darkfrei »

New version, a lot of changings.

Image
particles-1-03.love
(3.67 KiB) Downloaded 369 times
Attachments
2020-11-15T18_37_33-Particles v1.03 (Löve 11.3).png
2020-11-15T18_37_33-Particles v1.03 (Löve 11.3).png (8.39 KiB) Viewed 7196 times
2020-11-15T18_37_33-Particles v1.03 (Löve 11.3).png
2020-11-15T18_37_33-Particles v1.03 (Löve 11.3).png (8.39 KiB) Viewed 7196 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
NobodysSon
Prole
Posts: 33
Joined: Tue Oct 30, 2012 10:37 pm

Re: Particles

Post by NobodysSon »

Mesmerizing to watch...
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Particles

Post by ReFreezed »

It's close to simulating flocking behavior, except the particles cannot make up their mind about what flock they belong too. :P
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Particles

Post by Germanunkol »

This is really cool, they look so alive!
Does the particle size affect the gravitational pull? if so, it would be really cool to see what happens if every now and then one or two very large (one cm?) particles appear, maybe with a very low speed?

Would you care to share what the "more complex rules" are?

There was another cool flocking simulation here a few years ago, that also looked quite cool: https://love2d.org/forums/viewtopic.php?f=5&t=78542
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: Particles

Post by darkfrei »

Germanunkol wrote: Tue Nov 17, 2020 5:54 pm Would you care to share what the "more complex rules" are?
All particles have same mass by this simulation. See Gravity simulation for various masses: https://love2d.org/forums/viewtopic.php?f=14&t=89764

This rules are not mine, just my implementation of them;

There is 3x9 = 27 types of particles:

Main types A, B, C:
The A attracts to another A.
B has no reaction to another B.
C repels from another C.

There is 9 types of As:
A1 attracts B and C;
A2 attracts B, but no reaction to C;
A3 attracts B, but repels C.

A4 has no reaction to B, but attracts C;
A5 has no reaction to B and C;
A6 has no reaction to B, but repels C.

A7 repels B, but attracts C;
A8 repels B, but no reaction to C;
A9 repels B and C.

Same rules for B1-B9, C1-C9.

The attraction for A will be colored as red 255;
No reaction to A will be colored as red 191;
The repulsion from the A will be colored as red 127.

Same: Reaction B as green color channel, reaction to C as blue color channel.


Thanks for flocking, but it doesn't work on Löve 11.3.

New version just with 135 partickles:
Attachments
Screenshot_20201119-122742.png
Screenshot_20201119-122742.png (40.83 KiB) Viewed 6881 times
particles-1-04.love
(3.72 KiB) Downloaded 277 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest