5.4: Functions Inside of Objects - p5.js Tutorial

preview_player
Показать описание
This video dips a toe into the topic of object-oriented programming and looks at what happens when a function is embedded inside a JavaScript object.

Help us caption & translate this video!

Рекомендации по теме
Комментарии
Автор

Danial doesn't mess around with silly outros, "annndd I'm gonna stop now." I love it!

SuperShredderOR
Автор

Starting to get a little confusing, but you’re such a great teacher I don’t mind rewatching to get it right. Thank you!!

clayleone
Автор

Best explanations! There's nothing like this on youtube and the whole internet for that matter.

oscarmejia
Автор

Awesome Video! Coding is so great with the help of your tutorials. Greetings from Germany! :)

dmax
Автор

Every video of yours has some aha moment ..which makes me understand JS better. Thank you SIR!

nitinroy
Автор

I'm from VietNam and I'm 19. So wonderful to see you. I'll comment here and 1 year later I will come back.
Thanks for all videos so much.. =)))
Hope you make a lot of tutorials about games programing. I want to see my friends play my game hihiihi

jackvu.hustle
Автор

started getting into coding these videos help a lot.

davidbaker
Автор

Coding is so much fun and simple with you

russelpeter
Автор

I am from India English is biggest task form me but your teaching method is awesome this video was so helpful for me

DevenderSingh-yohu
Автор

awesome...this is the best videos i ever encountered related to programming ...even i got into programming because of you ...you are just awesome ..

JS-hfjw
Автор

Easy to understand. Explained in a nice way. Thank you Sir 😊

sandeeppaul
Автор

This didn't help a little. It helped a freakin lot. Thanks man.

ByTheWae
Автор

Your videos have been helping me a long through javascript. You are great at explaining things! Thanks!

JollyDillPickle
Автор

You made the world a better place by giving that bubble its own object.

nitinroy
Автор

Hey Dan I hope you see this.. This video is NOT part of playlist "1-7 Foundations of programming Javascript" also.. That playlist contains video 16.4 in the middle of chapter 7.. I didn't realize I missed a video until I scrolled through your uploads!

anthonyd
Автор

Finally clear now. So well explained! Thx!

kevinhaesendonck
Автор

Hey Daniel, I'm really confused about something. I'm trying to make a small little program where you click the mouse and it randomly places a ball object on the screen. I use x: random(1, 100) with my Ball object defined before setup, draw etc. However, the console says "random is not defined". I'm not sure why this is as you have done the same thing (x: this.x += random(-1, 1 )).

Any ideas? I thought random() was a JS thing in general, not a p5 thing!

var Ball = {
x: random(100, 200),
y: 100,
speed: 5,
draw: function() {
fill(100, 200, 50);
ellipse(this.x, this.y, 10, 10);
},
move: function() {
if(this.y < height - 10) {
this.y += this.speed;
} else {
}
}
}

stevemakesgames
Автор

Your videos are helping me a lot....thanks!!!!

yoelbeche
Автор

Hey Daniel! You're videos are some of the coolest and most useful things ever, literally. I'm trying to find the time to watch them all. My question regards objects. In p5, we create sprites using var p = createSprite(). Then we can change attributes to our Sprite such as speed, (p.setSpeed()), or width (p.width = 5), right? So if I make a constructor, enemies, which is intended to create an enemy, and make an array of those enemies, but then wish to alter their speed, am I allowed to use those properties with my own object I made?

I assume no because I didn't add those properties to my object, those properties are only apart of group() or createSprite(), but I don't know for sure.

AlexPena-mmme
Автор

Watching all your tutorials, just wanted to say thank you!! :D

TheNuNoPalma