Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Particle System without libraries?  (Read 1592 times)
0 Members and 1 Guest are viewing this topic.
Offline JoshuaCrotts

Senior Newbie


Exp: 2 years



« Posted 2017-03-18 20:24:53 »

Are there any good particle systems that are effective/good-looking that don't utilize LWJGL, OpenGL, etc.? I realize that there are plenty of good particle systems with the usage of these libraries, but I'm not wanting to make the full transition to these yet; I would like to stay with Java2D. Does anyone have code for good particles, or a step in the right direction to making somewhat professional ones? Thank you.
Offline philfrei
« Reply #1 - Posted 2017-03-19 03:47:28 »

This is a nice one.

Okay, it isn't Java2D. It's better than Java2D..it's JavaFX.
JavaFX is standard with Java now. It has many advantages over Jav2D/Swing, including being much more aligned with the functional programming paradigm and many new Java features like lambdas.

The code for this program is worth checking out.

music and music apps: http://adonax.com
Offline JoshuaCrotts

Senior Newbie


Exp: 2 years



« Reply #2 - Posted 2017-03-19 21:27:37 »

It looks really nice, I'll admit. Is there a way to implement it without directly using JavaFX? Like, I know I have to extend Application and whatnot, is there a way around it? Can I use this engine AND use Java2D together?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #3 - Posted 2017-03-20 01:59:36 »

I don't know any way (or reason) to use JavaFX and Java2D at the same time in the same stage/window. JavaFX has ways to running Swing controls, I think. I really haven't looked closely into this.

If you want an easy intro to JavaFX, this Java-Gaming tutorial could be helpful.

Otherwise, I recall that others have made particle systems and posted code here before, a few years back.

I tried a search on "particle system Java2D" in the local search box. Several threads came up. Maybe StumpyStrust's tutorial will be a help get you what you want.

music and music apps: http://adonax.com
Offline FabulousFellini
« Reply #4 - Posted 2017-03-20 14:53:02 »

I tried a search on "particle system Java2D" in the local search box. Several threads came up. Maybe StumpyStrust's tutorial will be a help get you what you want.

That is actually a pretty good tutorial for a basic particle system.

-FabulousFellini
www.fabulousfellini.com
Offline Cero
« Reply #5 - Posted 2017-03-20 22:43:53 »

well back in ye olden days I used to write one in Java2D. I mean the basics are very easy of course, you create new sprites per time x, they have a lifespan, they may fade over time, they get destroyed or better yet pooled, you can set any texture. and you apply a speed vector to them with randomness, well all attributes have randomness.

so you can probably do the basics really yourself in couple of minutes.

I remember back in the day on my single core laptop I could do 8- 20 k particle with java2D before dropping from 60 fps, that was without anything else of course
Given that you got better performance now and you usually only need like 10-200 particles even for complex effects, you are probably fine yo

Offline Cero
« Reply #6 - Posted 2017-03-20 23:12:04 »

I apparently I wrote this in like 2011:  https://puu.sh/uScTi/42894cc70a.zip

Maybe it will help, but like I said its very basic, might be more confusing.

Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (111 views)
2017-09-30 02:57:34

theagentd (147 views)
2017-09-26 18:23:31

cybrmynd (245 views)
2017-08-02 12:28:51

cybrmynd (241 views)
2017-08-02 12:19:43

cybrmynd (241 views)
2017-08-02 12:18:09

Sralse (255 views)
2017-07-25 17:13:48

Archive (874 views)
2017-04-27 17:45:51

buddyBro (1025 views)
2017-04-05 03:38:00

CopyableCougar4 (1578 views)
2017-03-24 15:39:42

theagentd (1376 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!