Experiment: Physical "Particles"

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Experiment: Physical "Particles"

Post by BlackBulletIV » Mon Aug 06, 2012 6:27 am

I've put together a new experiment that involves a whole bunch of circles with a high restitution (meaning they maintain speed for quite a while before slowing down). You can place individual particles, particle spawners, adjust speed (done by multiplying the delta time), and send a shockwave from the mouse's position to get things moving again. This includes the motion blur effect like last time, though implemented in a module of sorts.

Controls (copied from main.lua):
LMB to spawn a new particle at the mouse position
RMB to add an automatic particle spawner at the mouse position
Scroll to adjust the speed at which the world updates
Spacebar to create an outward explosion of force from the mouse position
M to toggle motion blur
Attachments
particles.love
(3.12 KiB) Downloaded 228 times

User avatar
silver_hawk
Prole
Posts: 36
Joined: Mon Feb 27, 2012 2:19 pm

Re: Experiment: Physical "Particles"

Post by silver_hawk » Mon Aug 06, 2012 5:27 pm

This is nice, I get around 170 FPS with 500 particles :)

User avatar
Lafolie
Inner party member
Posts: 805
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Experiment: Physical "Particles"

Post by Lafolie » Mon Aug 06, 2012 7:05 pm

Once again you show mastery over box2d. This reminds me of that awesome PS2 game Fantavision.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.

User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Experiment: Physical "Particles"

Post by BlackBulletIV » Tue Aug 07, 2012 5:33 am

Thanks guys.

I wouldn't call it mastery though; I haven't even used joints yet! :P

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Experiment: Physical "Particles"

Post by Robin » Tue Aug 07, 2012 9:26 am

Nice. When I get to 1000 particles, it still runs 60 FPS for me (just like it does at 500), and when I get to 1400 it runs at 50 FPS. At 1700, I get 40 FPS, I think I'll stop there.
Help us help you: attach a .love.

User avatar
Nixola
Inner party member
Posts: 1944
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Experiment: Physical "Particles"

Post by Nixola » Tue Aug 07, 2012 9:27 am

At 370 I had around 20 FPS (without motion blur), I pressed space and it froze...
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Experiment: Physical "Particles"

Post by BlackBulletIV » Wed Aug 08, 2012 7:00 am

Yeah, it's not very efficient (especially the force push thing; I'm pretty sure that could be done better).

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests