4.2: ArrayLists in Processing – The Nature of Code

[ad_1]
This video shows how to use an ArrayList for creating a Particle System.

Read along:

Example:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

14 responses to “4.2: ArrayLists in Processing – The Nature of Code”

  1. ScamRev Avatar

    Wish I could find out how to get past the get(0) to the values of the objects. Without 50 lines of code

  2. Tarkus Avatar

    I don't think I fully understood the .get() method.
    When you write

    Particle p = particles.get(4);
    p.update();

    it means you're declaring a copy of the 5th particle and you're naming the copy "p", right?
    so with p.update() you're updating the copy, not the array itself, right?

    what am I missing here?

  3. ginga2122 Avatar

    Thank you so much!

  4. dhruv gaur Avatar

    I want to see you without beard.

  5. Zebsy Avatar

    Good fun watch, thanks. Is this Java ? chrz

  6. newgame Avatar

    this is really awesome!

  7. Gorazd Rosbach Avatar

    Hi Daniel! First of all, thank you for your everything, giving to us! I really enjoy watching you, explaining things to us with such an enthusiasm! Second, I have a question. In your example, you use particles.add(new Particle()); which in my case does not work. I had to use particles.add(new Particle(new PVector(width/2, 20))); like in the example with only one particle. I'm using Processing 3. Regards!

  8. Luca Avatar

    In the beginning you wrote Particle [] particle = new Particel [100];

  9. Pratyush Raman Avatar

    Also, in the description, the link for github location is outdated, you have used a 0 prefix in the new folder structure. Please update the same for other viewers 🙂

  10. Pratyush Raman Avatar

    Hey when I try running this, I get:
    build.pde:7:0:7:0: The constructor build.Particle() is undefined

  11. Michele Zaccagnini Avatar

    Daniel, Thanks a lot for your awesome videos. Quick question: I am using Processing in Python mode and I can't find a Python version of ArrayList. Do you know if there is some class that can substitute it? Or is it in the making?
    Thanks!

  12. Volkan Tuncay Avatar

    This guy is great 🙂 Quite fun to follow…

  13. BaconKwagga Avatar

    my particle is a star shape but it is too big. what's a good way to resize the particle?
    edit: i couldn't do it with scale(), the stars would go crazy and all over the screen. it works with ellipse or rect, weirdly. so i eventually did it by tweaking the vector values and it's sort of okay but it's not the same thing.

Leave a Reply

Your email address will not be published. Required fields are marked *