Everything runs perfectly in java mode, but in javascript mode the sketch remains grey. I went through all threads etc. and can´t find the problem please help!!!
I wrote a sketch, that allows you to "customize" a particle system ("soul") in the first step. In the second step, you can send it to the "Universe".
If there are multiple particle systems in the universe, they are attracted to each other according to their visual similarity, and they start building cool constellations.
I tried to keep the code structured, but it´s my first sketch ever, so it could probably be a lot shorter and smarter, but there´s not a lot i can do about that now. Please download the whole sketch from
souluniverse_web.zip and try it out (it´s fun!)
I avoided these common mistakes:
-I am not using libraries
-I`m preloading the images and I put them in the same folder
What i suspect to be the problem:
-Something wrong with the ArrayLists
-Something wrong with the images
-Use of functions not supported in javascript
I can´t post the code here because it´s too long. This is how the code is structured:
the "Souluniverse":
Here, Everything is set up. Switches between "creating a soul", and "viewing the universe" mode.
the "Universe" class:
Contains the ArrayList with all created souls. Handles the interactions between the different particle systems: measures their distances, calculates their attraction to each other etc.
the "Button" class:
The button "send to the universe".
the ControlPoint class:
The controlpoints you can pull in the "create soul" mode to change it´s characteristics. It Passes the values on to the nowCreatedSoul object
the nowCreatedSoul class:
The "Soul" you edit in the "create soul" mode. It contains a particle system object.
the ParticleSystem class:
My modified Particle System
the savedSoul class:
Once the nowCreatedSoul is "send to the universe", a new savedSoul object is created and stored in the arrayList in the Universe object.
The mouseControl part:
contains all mouse interactions.
again: Please download the whole sketch from
souluniverse_web.zip and try it out, you will enjoy it as well :)
Any hints why it doesn´t run in javascript mode are highly appreciated!!!! Thank you all already.