This video shows how to use an ArrayList for creating a Particle System. Read along: natureofcode.co... Example: github.com/shi... 📄 Code of Conduct: github.com/Cod...
Пікірлер: 67
@macieg82345 жыл бұрын
Almost 4 years later - people are still watching your videos. You’re one of the best programming teachers I’ve ever had. I’m IT student from private IT academy and you are better than my lecturer - and your lessons are free. Within couple of weeks I’ll link your videos to my friends that are learning Java too. Stay awesome and make more videos!!! ❤️
@simonhollad55114 жыл бұрын
Maybe because its private academy....
@DuniC03 жыл бұрын
And people are still learning Java...
@exhydraboy24296 жыл бұрын
World's best Java Teacher.
@shyamavs42354 жыл бұрын
I was in bed, watching this, and sort of falling asleep, imagine my shock when he said 'don't fall asleep, wake up' !!! :O
@ericboyer66526 жыл бұрын
Thanks Dan. Fed up with working with predefined size arrays, following you on neural network stuff and trying to implement that in a arduino robot, i got to come back to this usefull video. As usual when stuck, I got to get back to fondementals, and so thanks for this usefull piece. Have a great day.
@72li2085 жыл бұрын
I take a moment to recognize your great work. I'm not a full time programmer but I've been doing a couple of web apps for my company and your javascript tutorial were always of great use, especially that p5.js is used a lot for visual animation and one can see directly the practical meaning behind the code. Now I'm taking up Java and I always have a look at your videos to assimilate the key principles. Thanks a lot !
@wollkann8 жыл бұрын
This guy is great :) Quite fun to follow...
@TheCodingTrain8 жыл бұрын
+Volkan Tuncay Thanks!
@Architector_45 жыл бұрын
When I learned Processing, I ditched any tutorials and only studied the reference. Now I regret doing that. Not because I learned something the bad way or don't know something, but because I missed this beautiful, energetic man. ._.
@bengray83196 жыл бұрын
hey just wanted to give you a massive thank you, you've been a great help to me in this video :)
@TheCodingTrain6 жыл бұрын
So glad to hear!
@bastibob6604 жыл бұрын
Thank you 😁 That really really helped me out Huge respect to your programming and explaining skills 👏
@sulfrum7 жыл бұрын
it is what I was looking for... and the number of this video is 42... it couldn't be only a coincidence :P
@johanrojassoderman55904 жыл бұрын
Wait, lists have types o.O JavaScript isn't even obnoxious AND consistent. It's just obnoxious. Great video btw, I have done some coding in c# but wanted to try something different, and your videos are as interesting even if it reintroduces things I recognice from c#. Perfect balance between efficiency and clarity.
@elizaknight69806 жыл бұрын
Thanks so much, I need this for my game project :)
@newgamedk7 жыл бұрын
this is really awesome!
@rgorazd7 жыл бұрын
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!
@FreeDomSy-nk9ue4 жыл бұрын
That was a very good explanation just like the lag in it.
@zippobrand3 жыл бұрын
Hi Dan, I'm really hoping you will revisit this subject in your new Nature of Code and maybe explain how to sort an ArrayList because I'm having a hard time understand this and implement it in processing. Love.
@threadsnakegaming4 жыл бұрын
when his get looks like a cross between get and set, perfect for instruction
@threadsnakegaming4 жыл бұрын
and the fact that his semicolon looks like a j
@cesarbranco18893 жыл бұрын
Dude this Prof took so much Kaffee, he is kind of crazy! haha I loved it
@polyroguegames58206 жыл бұрын
Hey so if anyone is following this but using p5.js, you don't have to worry about ArrayList, since p5.js' array data structure is dynamic :)
@warrengeorge71266 жыл бұрын
A lot to take in but explained brilliantly
@Charlie051555 жыл бұрын
Man I really need to thank you
@DancingKeanu10 ай бұрын
1:24 The way he made that noise 🤣🤣🤣🤣
@imtrying39816 жыл бұрын
IM SO HAPPY IT VHRISTMAS DAY!!!
@lulila_2 жыл бұрын
Hey Dan! Could you make a video about string lists and text input from user? That would be super useful, thanks!!
@DasCartoonLand5 жыл бұрын
dude youre the best!
@eandresrodriguez5 жыл бұрын
Hi Daniel, you're such a great teacher. I write a "basic game" using processing and what you taught in ArrayList videos, but I got a weird behaviour that I'd like to help with. How could I share you my code to get comments from you or your java programmers followers?
@TheCodingTrain5 жыл бұрын
I would suggest discourse.processing.org/! It's a good platform for Processing and p5.js related code questions. You can share code there easily! Feel free to link from here to your post.
@DuniC03 жыл бұрын
Hi, I was wondering... why not use Java's Set, like HashSet, TreeSet or LinkedHashSet?
@END-oc4qu6 жыл бұрын
Hey if I wanted to multiply a 2 dimensional array by a value like 10 that has 3 rows and 4 columns with initial values present in each location, why would I set the "setw(5)" with the 5 argument instead of a (4) argument in this manipulator function.
@nektoxyz10134 жыл бұрын
why i cant create array of particles with : Particle[ ] particles = new Particle(50); i missed something? or something has changed in JS? Thanks.
@prtysh7 жыл бұрын
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 :)
@MicheleZaccagnini8 жыл бұрын
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!
@TheCodingTrain8 жыл бұрын
+Michele Zaccagnini You can just use a regular array in Python which is exapandable. See the Python Mode examples (Particle System or Flocking) for how it's done. Thanks for watching!
@avemew54072 жыл бұрын
I managed to add and place objects from an array list and delete objects after clicking a button and then the object I want to delete, how in the world can I change the position of ONE object after clicked...? best regards ^^
@lucianopazona99768 жыл бұрын
Gracias!
@Zebsy7 жыл бұрын
Good fun watch, thanks. Is this Java ? chrz
@TheCodingTrain7 жыл бұрын
Yes indeed it is! (Using Processing as an IDE)
@puffolino17 жыл бұрын
In the beginning you wrote Particle [] particle = new Particel [100];
@thefigmaster35196 жыл бұрын
Hi Dan, great vid! Do you have the working github link?
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?
@reginahilt7 жыл бұрын
He said it passed the reference of the object. That means it is accessing the object itself and updates it.
@bettyevdokiagulayev44954 жыл бұрын
love
@scamrev58007 жыл бұрын
Wish I could find out how to get past the get(0) to the values of the objects. Without 50 lines of code
@bennybrouwer7 жыл бұрын
It is not very clear in the documentation but as far as I understand, .get() is deprecated and should be replaced by the .copy() function, e.g. for copying a PVector named loc: location = new PVector(); location = loc.copy(); however, for a particle, the get() function still works - I don't know why
@samvoor4963 жыл бұрын
what programming language is this in?
@prtysh7 жыл бұрын
Hey when I try running this, I get: build.pde:7:0:7:0: The constructor build.Particle() is undefined
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.
@eotikurac9 жыл бұрын
+Daniel Shiffman i got the star particles in the right place with this method but they fall more slowly, as if the vector has been affected by scaling the shape down. this is bothering me a little because i don't know what is it that i'm doing wrong, but later in the chapter you showed how to inherit stuff from the main particle and use it for other particles so i got it going eventually and it looks spot on, so it doesn't really matter all that much. thank you.
@maciejjakubiak28285 жыл бұрын
Wait, I wrote EXACTLY the same code as you done, but it didn't work. What's going on?
@maciejjakubiak28285 жыл бұрын
Sorry, I didn't gave the particular reason of sketch bug. Somewhere in "particles.add(new Particle());", the program returns a error: "The constructor "Particle()" does not exist".
@TheCodingTrain5 жыл бұрын
Would you mind asking at discourse.processing.org/! It's a better platform for Processing and p5.js related code questions. You can share code there easily! Feel free to link from here to your post.
@melik-alexandrefarhat21855 жыл бұрын
In Java, I've always declared and initialized my arrays like this: float[] numbers = { 1.76, 1.68, 1.89, 1.72, 1.54, 1.78, 1.34, 1.78 };
@DancingKeanu10 ай бұрын
2:49 "blue" "giant"🤣🤣🤣
@imtrying39816 жыл бұрын
OOPS i mean CHRISTMAS
@dhruvgaur70477 жыл бұрын
I want to see you without beard.
@teamnitrogen2107 жыл бұрын
that would be really weird
@PTM10084 жыл бұрын
7:24 is the biggest lie ever told in the history of mankind. That too again and again!