Тэги:
#mouseIsPressed #p5.js #javascript #button #rollover #tutorial #conditional #boolean #Boolean_Data_Type #Variable #boolean_variables #boolean_variable #p5js #daniel_shiffman_boolean #javascript_example_for_boolean_varaible #p5.js_button #rollover_daniel_shiffman #p5js_tutorial #p5.js_tutorial #variables #javascript_(programming_language) #conditionalsКомментарии:
👍
Yea,its true!
Your videos are great! Keep up a good work ;)
He should be my coding teacher, he is insane!!!!
ОтветитьIt it’s true I watch the video in sequence and I plan on finishing the,
ОтветитьEverytime i press something, it detects it like 3 or 4 times. So, i can not switch on and off consistently. How can i solve this
Ответитьgood
ОтветитьThen I live in your fantasy world.
Ответитьvar watchingVideoIn Sequence = true
ОтветитьTons of people are watching, you do an insanely good job making the content easy and fun! Thanks for making all of your videos :)
ОтветитьAHHHHHHHHHH this is so great
ОтветитьThe best teacher I have ever seen . The way he explains the importance of boolean data is brilliant 🥵
ОтветитьI think at this point we need a video about the general concept of data types and what they're implemented in JS and p5.js. Maybe you already have one in the following videos :)
ОтветитьHis if( mouseX > 250 && mouseX < 350.... ) is bothering me. This means that if approaching the square from the left, it will be filled before you even touch it. Similarly, if you approach it from the right it won't get filled at the 400 pixel mark (which is when the square starts from the right.
The correct numbers should be mouseX > 300 && mouseX < 400.
Could you explain why you did 250 and 350 for X please?
God bless you Dan!
ОтветитьIt 2021 and we are still watching. Thanks for your great work. Your deserve a nap.
Ответитьplss tell me 😢🙏whats the error in this code here i am not getting background colour even when mouse is pressed
var on = false;
function setup() {
createCanvas(600, 400);
}
function draw() {
if (on) {
if (mouseIsPressed) {
background(0, 255, 0);
} else {
background(0);
}
}
background(0);
stroke(255);
strokeWeight(4);
noFill();
if (mouseX > 250 && mouseX < 350 && mouseY > 150 && mouseY < 250) {
fill(255, 0, 200);
}
rectMode(CENTER);
rect(300, 200, 100, 100);
function mousePressed() {
if (mouseX > 250 && mouseX < 350 && mouseY > 150 && mouseY < 250) {
on = !on;
}
}
}
haha, yes watching all videos after videos, thanks for your work help a lot.
ОтветитьHello everyone! when i put "function mousePressed() " in DRAW it does not work for me, in this example to turn the rect pink.
putting it in setup i do not get the issue, however i need it in draw
create 500 black shapes with a 40% chance that they'll be red and if they land on the top half of the canvas make them smaller.
ОтветитьI once was supposed to make a game where you have a button that will jump away after a few seconds and you have to press it in time and get a point each time you press it. But I was a bit mean and instead made it that the button will jump away if you get near it with the mouse. :)
ОтветитьMate, im watching these video one after another. Thank you for these thoroughly enjoyable series of lessons and introduction to P5. Greetings from Dusseldorf
ОтветитьWatching in sequence with little peaks in the future for motivation. I am starting from scratch with zero coding background, and you sir are an awesome teacher, I can't thank you enough for these videos.
ОтветитьDont work too hard! your a dope teacher 🙌🙌
ОтветитьI rarely write comments but I just have to thank you for these videos. I stumbled upon Creative Coding and p5 while looking for some fun side projects to do while working on The Odin Project. Your videos have really helped me grasp and understand the concepts that I've been learning so far and have been immensely helpful for me to visualize what all these functions and commands are actually doing in JavaScript. Its been so refreshing to be utilizing everything I've learned so far in a different way by making something creative. Thank You!
ОтветитьI learnt alot... but only attentive students will hear the sirens at the background at some point in this video
Ответитьon=!on;
Ответитьits true I'm watching them.
ОтветитьHELP! It doesn't work for me, I don't know what I'm doing wrong,...
var x = false;
function setup() {
createCanvas(600, 400);
}
function draw() {
if (x) {
background(50, 200, 50);
} else {
background(50);
}
function mousePressed(){
x = true;
}
}
Actually, most of my class is watching this series! Thank you for making this, I am wildly lost for 99% of my assignments, and these videos have gotten me through every one of them.
ОтветитьDon't be "fooled" by the title. We learn many p5js specific concepts here. Important p5js stuff like "mouseIsPressed" and "mousePressed()" will be explained carefully by Daniel. That's why I don't want to skip any one in this 100-video series. There are still 87 to go.
ОтветитьI am watching these in sequence. :)
Ответитьhow do you put all that stuf in comments at once?
ОтветитьI actually watch them in order, thank u! It helped tons.
ОтветитьYou ask, if any<body watches the videos in a row --> that is me
ОтветитьThank you for making this videos, I watch your videos and also coding along with it. Your videos explain things throughly and it helps me learn how to code in general, not just in JavaScript p5js. Thank you, Sir. 😎👍
ОтветитьBro, you are awesome! , thanks for teach, and thanks for teach how to teach, im looking your videos 1 by 1 just because i'm having fun.
ОтветитьThanks!
ОтветитьThank you so much for the video. but I would suggest understanding the coding "0n=!On" as PUTTING a new value to the variable in a logical expression way since the syntax used the " = " as the working launguage.
It would be easy to understand for me, and not be much confused by the logical understanding of what "=" means.
many thanks again, very helpful for me, a 45-year-old start learner of programming.
if mousePressed = true
laptop begins to float
XD
Still after 7 years, we are watching your videos and of course in order! Thank you, you're the best teacher!
Ответитьyes, im watching... also, in order :)
Ответитьkinda repetitive i know🤔
var x=200,y=200,speedx=2,speedy=3,d=100,c;
function setup() {
createCanvas(400, 400);
c=createGraphics(400,400);
c.clear();
}
function draw() {
if(d>200||d<100||speedx>16||speedy>=48){
d=100;
speedy=3;
speedx=2;
}
background(220);
c.rectMode(CENTER);
c.rect(20,380,20);
c.rect(50,380,20);
c.rect(80,380,20);
c.rect(110,380,20);
c.rect(140,380,20);
c.rect(170,380,20);
c.rect(200,380,20);
if(x<=d/2 ||x>=width-d/2){
speedx*=-1;
}
if(y<=d/2 ||y>=height-d/2){
speedy*=-1;
}
x+=speedx;
y+=speedy;
circle(x,y,d);
text('X',x-30,y-10);
text('X',x+20,y-10);
arc(x,y,50,20,0,PI,CHORD);
c.text('Y',46,385);
c.text('X',16,385);
c.text('S+',74,385);
c.text('S-',104,385);
c.text('Sx',134,385);
c.text('Sy',164,385);
c.text('R',194,385);
image(c,0,0);
}
function mousePressed(){
if(mouseX>10&&mouseX<30&&mouseY>370&&mouseY>360){
speedx*=-1;
}
if(mouseX>40&&mouseX<60&&mouseY>370&&mouseY>360){
speedy*=-1;
}
if(mouseX>70&&mouseX<90&&mouseY>370&&mouseY>360){
d+=20;
}
if(mouseX>100&&mouseX<120&&mouseY>370&&mouseY>360){
d-=20;
}
if(mouseX>130&&mouseX<150&&mouseY>370&&mouseY>360){
speedx*=2;
}
if(mouseX>160&&mouseX<180&&mouseY>370&&mouseY>360){
speedy*=2;
}
if(mouseX>190&&mouseX<210&&mouseY>370&&mouseY>360){
x=200;
y=200
}
}
we are watching :D
Ответитьstill we are watching your videos, and Also I'm yousing your video to teaching
ОтветитьI made to make the turn on/off work but not in dependence of the mouseX mouseY position. Even if I click outside of the rectangle the switch is working. Does anyone know how do fix it?
ОтветитьWhen I was using a mouseIsPriessed, the execution didn't work. So, I tried functionmouseClicked instead, and it works. (Oct, 2024)
ОтветитьI’ve been watching your videos on and off for over 4 years now. I appreciate what you do !!
Ответить