Тёмный

Growing Tentacles with Code 

Barney Codes
Подписаться 17 тыс.
Просмотров 1,9 тыс.
50% 1

Опубликовано:

 

21 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@BarneyCodes
@BarneyCodes 2 года назад
I've gone for a bit of a different style in this video, less of a live-coding video and more of a tutorial. Do you prefer this new style, or did you like the old style better? Let me know! Also, feel free to let me know if there are any projects you'd like to see me do in the future! Be sure to check out my other P5js videos here: ru-vid.com/group/PLlaA0JvEhcG8kb6x-Cc3RM5JMjq4ribQ5
@basumaiku
@basumaiku Год назад
Loved this, thank you! I’ve seen and done a number of fractal tree tutorials, but am looking for one to create something more vine-like (animated or not), which brought me to this video :) I imagine I could work with this, but would love to see a vine-with-leaves tutorial if you’re up for making one. Either way, thanks for the great tutorials, you’ve already been a tremendous help!
@BarneyCodes
@BarneyCodes Год назад
@@basumaiku Glad you enjoyed it! A vine structure sounds really cool, and I think you could achieve it in a similar way (making them green would be a good place to start!) You could also give each circle a random chance of becoming a leaf using if(random() < chance) { //spawn leaf here} and tune that chance so that the vines are as leafy as you want them to be! If you end up doing this I'd love to see it, and I might make a video on it in the future because it sounds like fun! Thanks again for your comment :)
@basumaiku
@basumaiku Год назад
@@BarneyCodes Thanks so much! I’ve started trying to modify the tentacle code and have gotten some good rendering of what what be the smaller vines that branch off, but still working on the main vine and leaves. Will circle back once I have something! Appreciate your help!
@jorjkanadi6598
@jorjkanadi6598 2 года назад
Your videos are great! Thank you!
@BarneyCodes
@BarneyCodes 2 года назад
Thank you so much, glad you're enjoying them!
@36nibs
@36nibs Год назад
I seen someone do something similar with multicoloured tentacles codeBoss
@BarneyCodes
@BarneyCodes Год назад
Sounds interesting! I'd love to check it out but when I tried to google it I couldn't find anything!
@lainleaflet
@lainleaflet 2 месяца назад
hello again! I'm trying to expand on this code by having multiple sets of "tentacles" appear on the screen guided by a mouse click and its position. the best i've gotten is to move the "points = [];" line within the if (point.rad
@BarneyCodes
@BarneyCodes 2 месяца назад
Hi! Sounds like a fun project! My first thought would probably be to create a class which would handle a single set of tentacles, called something like TentacleManager (or maybe octopus? ha!). Each instance of the manager class would have it's own set of points, so one tentacle burst finishing doesn't interfere with any other. You would then have a global array of the managers, instead of single points, and when a manager has finished (you'll need some function on the manager to check for this!), you can remove it from the array of managers. And when you click, you can adda a new manager! I hope that makes sense, let me know if you've got any questions!
@lainleaflet
@lainleaflet Месяц назад
@@BarneyCodes hi, thank you for the response! sorry to reply so late, i haven't been able to touch coding in a bit lolol with regards to the new class, would i essentially send an array of the new points into the manager class, which would then be put into the new global array of managers? and in this case, would i still need the global point array, or should i do something completely different? also, regarding the manager class itself, would i check for when a group of points finish in an update function inside, or would i check for it in the regular draw function? and would i need to account for a draw function inside of the manager class as well? sorry if the questions are messy, i haven't used classes much and i'm mostly relying on previously written code to navigate the issue. thank you for all the help!
@BarneyCodes
@BarneyCodes Месяц назад
No worries at all, life can get busy! It can be a bit hard to convey this stuff over comments like this, sorry! I've just made a new multi-tentacle version which you can find here: editor.p5js.org/BarneyCodes/sketches/7pHQENcIY Essentially what I've done is wrap the points array and the updating logic that used to just be in the draw function, into it's own class. What this lets us do is create multiple, individual instances of the tentacle burst effect (we've basically packaged up what we had before into a reusable block, which lets us have multiple tentacles at the same time) Each time we click the mouse, we create a new copy of the manager class. Inside the constructor for the manager, we do pretty much everything we used to do inside the createBurst function. You'll see the new draw function only loops over the managers (using the filter function, which lets us loop over all the managers, and if they're done, they are removed. The filter function just lets us do both of these steps at the same time!), inside the loop, we call the update function on the manager, which as you can see has pretty much the same code as the old draw function did. In this way we're able to separate out each burst so that one finishing does not prevent the others from finishing as well! Hopefully the code I've shared will do a better job of explaining than I have done!! If you've got any more questions, please just reach out!
@lainleaflet
@lainleaflet Месяц назад
@@BarneyCodes thank you so much for taking the time to write this out! it was a bit tricky to decipher how to work out the scope of things and rearrange what should be where for the new code, so seeing your code and the explanation helped out a lot. i've gained a better understanding of classes and how p5 operates, so i appreciate this!
Далее
Simulating Ink Drips with P5js
12:13
Просмотров 2,4 тыс.
Introduction to shaders: Learn the basics!
34:50
Просмотров 334 тыс.
БЕЛКА РОЖАЕТ?#cat
00:20
Просмотров 307 тыс.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
Просмотров 895 тыс.
Side-effects of doing VERY long runs in Noita
10:24
Просмотров 65 тыс.
Everything Starts with a Note-taking System
21:23
Просмотров 251 тыс.