Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Two humble questions on the topic of particles

Author
Message
basicFanatic
2
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 29th Aug 2019 01:12
1) I know how to create a particle emitter and just have it do its thing. But what if I just want a single burst, like from an explosion?
2) I think I remember that I could feed a particle emitter random values. But possibly, I just thought that I could, and discovered that I couldn't. Which is it?
PSY
Valued Member
3
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 29th Aug 2019 03:29 Edited at: 29th Aug 2019 03:30
1)
- SetParticlesAngle ( 1, 360 ) to burst the full 360°
- Use a high value with SetParticlesFrequency so all particles emit at the same time
- You might use UpdateParticles to advance time which will get you a perfect circle

2) Why not use Random() with the particle commands?


PSY LABS Games
Coders don't die, they just gosub without return
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 29th Aug 2019 04:01
try

fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Aug 2019 05:58
I found that as well. There is no way to set particle friction or damping so it slows over time
Onomatopoesie
User Offline
Joined: 6th Aug 2019
Location: Germany
Posted: 29th Aug 2019 07:56
I think you can do something like friction or damping with AddParticlesForce (ID, starttime, endtime, x, y). Or am I wrong?
PSY
Valued Member
3
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 29th Aug 2019 22:17
Is this about 2D or 3D particles?


PSY LABS Games
Coders don't die, they just gosub without return
smerf
14
Years of Service
Recently Online
Joined: 24th Feb 2005
Location: nm usa
Posted: 30th Aug 2019 07:28
id like to be able to rotate a paritcle
[Imgur](https://i.imgur.com/CsOc7ed.png)[/imgur]


Onomatopoesie
User Offline
Joined: 6th Aug 2019
Location: Germany
Posted: 30th Aug 2019 13:26
I just played around with the particles and made you an explosion. Maybe it is helpful for you?

Conjured Entertainment
AGK Developer
14
Years of Service
Recently Online
Joined: 12th Sep 2005
Location: Nirvana
Posted: 31st Aug 2019 16:59 Edited at: 31st Aug 2019 17:30
@ Onomatopoesie

Very Nice Fireworks!

17 was my fastest on the first try, but could hold around 12 consistently.

Think I'll add the highest



Got a 19 on the third try, but never got above 18 after that.

Need a reset now...



Only 17 this time... my finger needs a rest already).
Great trigger finger workout for eSport athletes and a great thing for mouse manufacturers

The real fun will be in changing the colors for each explosion.
But yes, this is certainly helpful for everyone, thanks.
Probably will add a timer to it and then an average speed for the round too.
Then something else, then more stuff, and more stuff, then a whole game will have evolved from your explosion code snippet.
Now I am thinking of ancient sea battles with the Chinese using rockets to set the wooden ships on fire. (yet another project I will never finish and its all your fault )

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Onomatopoesie
User Offline
Joined: 6th Aug 2019
Location: Germany
Posted: 31st Aug 2019 19:06
Great. I did not think anyone would enjoy this code so much. I only got 14, but that are certainly timing issues.

Login to post a reply

Server time is: 2019-09-22 18:14:37
Your offset time is: 2019-09-22 18:14:37