Particles don't support collision ?

For questions about using Classic.

Post » Mon Jul 20, 2009 12:23 pm

I want to make particles like bullets, for a shoot'em up.
It would be interesting because you can set some random, so it would be harder to dodge the bullets.
Can I do that ?

I tried to do an Event :
[Particle => Collision with Sprite]
But it doesn't work.
B
3
G
3
Posts: 34
Reputation: 943

Post » Mon Jul 20, 2009 12:30 pm

It's infeasible for individual particles to test for collisions; in most cases it'd be very very slow. You can always create a custom particle solution if it's necessary.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Jul 20, 2009 12:32 pm

[quote:15l6rvxr]You can always create a custom particle solution if it's necessary.[/quote:15l6rvxr]
If I can do it, why the particles system included in Construct can't do it ?
The particles object should include a sprite spawning system.
B
3
G
3
Posts: 34
Reputation: 943

Post » Mon Jul 20, 2009 12:39 pm

The particle system's an optimised system of particle display which by optimisation precludes certain functions, which very few people need. Collisions for 1000s of particles would slow a game to a crawl, for example. (In any case, the particles are custom drawn, and are not sprites.)

Asking for certain things to be wangled into plugins or behaviors is like asking for a 'make my game for me button' :P.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Jul 20, 2009 12:47 pm

Creating sprites really shouldn't be that much trouble to be honest.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Jul 20, 2009 8:06 pm

this question has been asked b4 and will be asked again.... someone make a generic example of how to do that to point them to :?:
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Mon Jul 20, 2009 8:23 pm

Custom particle systems are actually surprisingly simple - it's effectively a bunch of sprites with bullet behaviors that have random adjustments to any aspect of the object such as speed, acceleration, angle, opacity, colour, etc.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Jul 20, 2009 9:57 pm

Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Tue Jul 21, 2009 1:43 am

If you're dead set on using the particle object, you could also paste the particles into a canvas each frame, update the collision mask, then test for collisions with the canvas.

Hey Ash, Optimization question...... :mrgreen:

You think the overhead of a full screen canvas with a particle object (along with the pasting of particles, and mask updating) be more efficient than collision checks, movement, and general runtime clogging of say, 5000 sprites? I'm thinking micro shump with thousands of bullets, where the sheer number of sprites would clog the runtime.

Will particle pasting Defeat massive sprite spawning in terms of performance? See who uses less Cpu cycles in the next episode of davioptimization. Cap coming shortly :mrgreen: !
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Tue Jul 21, 2009 3:40 am

It would depend on the order of complexity of pixel collision on Canvas, which I ignore.
It could be orders of magnitude slower.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest