5.2: If, Else If, Else - Processing Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024
  • This video covers how a conditional statement works in Processing with "if", "else if " and "else"
    Support this channel on Patreon: / codingtrain
    Contact: / shiffman
    Send me your questions and coding challenges!: github.com/Cod...
    Link to code on Github: github.com/Cod...
    Processing: processing.org
    Processing Foundation: processingfoun...
    Learning Processing Book: learningprocess...
    For More Processing Tutorials:
    www.youtube.co...
    📄 Code of Conduct: github.com/Cod...

ความคิดเห็น • 180

  • @standarrow9759
    @standarrow9759 4 ปีที่แล้ว +200

    Yandev
    Else if
    Else if
    Else if

    • @giornoisbestjojo605
      @giornoisbestjojo605 4 ปีที่แล้ว +6

      You'll never reach the optimization of your game
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-
      Else if-

  • @Dimitris_Pappas
    @Dimitris_Pappas 3 ปีที่แล้ว

    Thank you!

  • @dennisllante
    @dennisllante 7 ปีที่แล้ว

    You are awesome!

  • @Hussamaldeen-n1p
    @Hussamaldeen-n1p 4 ปีที่แล้ว

    thank u for made laugh 😆 it was fun disaster

  • @dalenassar9152
    @dalenassar9152 7 ปีที่แล้ว

    DUDE, It's great except for you saying -repeatedly- "it's all wrong, everything is going badly" etc. I have even taught myself to, when you do this, concentrate on the code you just wrote until you resume!!! It's GREAT otherwise. BTW, I really, really need to learn processing, and out of all that is on youtube, you are my only subscription. STOP hassling your great videos just when something major is sinking in!!

  • @ancis1327
    @ancis1327 4 ปีที่แล้ว +225

    Now I can make my own Yandere Simulator!

    • @Metaknightkirby2
      @Metaknightkirby2 4 ปีที่แล้ว +25

      But what if...
      else if
      else if
      else if

  • @naraugh1
    @naraugh1 8 ปีที่แล้ว +334

    Frankly, I think your nervousness and everything is what makes you so fun to watch and learn this with ha ha. It makes everything just more real, like there's an actual person showing us everything and not some monotoned professor with a god complex.

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +64

      thank you!

    • @Array_of_objects
      @Array_of_objects 2 ปีที่แล้ว

      couldnt agree more. Watching Swartzmuller is so difficult

  • @jefecker1
    @jefecker1 2 ปีที่แล้ว +9

    POV: You're Alex Mahan and you're about to develop a new game

  • @MolvouX
    @MolvouX 5 ปีที่แล้ว +127

    "im going to be redoing these anyway"- Daniel Shiffman, 2015

    • @ruudvanwesterneng9326
      @ruudvanwesterneng9326 4 ปีที่แล้ว +2

      truer words have never been spoken

    • @MisterYoupinet
      @MisterYoupinet 4 ปีที่แล้ว +4

      Sometimes i am like... Ooooh I will cut his video to please him.
      But I like it like that, I don't wanna break the charm

  • @MononobeNoFuton
    @MononobeNoFuton 4 ปีที่แล้ว +58

    Send this to yandere dev

  • @fizzie6902
    @fizzie6902 4 ปีที่แล้ว +55

    "I evaX, humbly submit: a toast to Nicholas Alexander for successfully managing to pirate Warcraft 3."

    • @flarestriker2005
      @flarestriker2005 3 ปีที่แล้ว +8

      "Congratulations Nick, enjoy your DOTA.... *S I P* ahhh"

  • @slug8039
    @slug8039 4 ปีที่แล้ว +42

    Oh, so *this* is where yandere dev learned to code!

  • @makenahawley
    @makenahawley 6 ปีที่แล้ว +59

    You are so weird and funny and adorable and a really REALLY great teacher, thank you!

  • @hyperturbofox17
    @hyperturbofox17 4 ปีที่แล้ว +15

    Oh This How Yandere Dev Learned How To Code.

  • @StrayFei
    @StrayFei 4 ปีที่แล้ว +10

    Are ya codin' son?

    • @youruncle9780
      @youruncle9780 4 ปีที่แล้ว +5

      Sure I am, Dad.

    • @melancholy9800
      @melancholy9800 4 ปีที่แล้ว +1

      @@youruncle9780 *Dad leaves*

    • @Soraform1
      @Soraform1 4 ปีที่แล้ว +1

      @@melancholy9800 wink

  • @youruncle9780
    @youruncle9780 4 ปีที่แล้ว +37

    Y'all know why I'm here

    • @youruncle9780
      @youruncle9780 4 ปีที่แล้ว +13

      @Michal Niestepski no I'm streaming dad

    • @KamiChrisy
      @KamiChrisy 4 ปีที่แล้ว

      Did you win, son?

    • @what2758
      @what2758 4 ปีที่แล้ว

      @@KamiChrisy No he didn't

  • @thatrtxdude
    @thatrtxdude 4 ปีที่แล้ว +8

    Yandevs favourite video dont change my mind

  • @TheLegoJungle
    @TheLegoJungle 7 ปีที่แล้ว +44

    9:53-10:35 Daniel_Shiffman.exe stopped working.
    Did he just troll by cutting of at the end like that? XD

  • @zerbatuk
    @zerbatuk 4 ปีที่แล้ว +26

    5 years later, these are still brilliant! So glad you never deleted this. Never edit out your charms :)

  • @cyberminato
    @cyberminato 6 ปีที่แล้ว +20

    Hope this one is correct...it's my first time in coding...love it. I learned a lot.
    void setup(){
    size(640,360);
    }
    void draw(){
    background(0);
    if((mouseX>width/2) & (mouseY>height/2)){
    fill(0,255,0);
    rect(320,180,320,180);
    }else if(mouseX>width/2 & mouseY

    • @Pindatje456
      @Pindatje456 3 ปีที่แล้ว

      I hope this is good? You tested it before you posted it here so of course you knew the answer already. Good job tho :)

    • @thuro431
      @thuro431 3 ปีที่แล้ว

      @@Pindatje456 you need to put 2 & instead of one

    • @thuro431
      @thuro431 3 ปีที่แล้ว

      It’s the same with the = one means that you need to set the value to the thing after it and == means that it should equal the value

    • @thuro431
      @thuro431 3 ปีที่แล้ว

      Idk if this is confusing but I hope it helps

  • @round5soundsfetchmetheirso827
    @round5soundsfetchmetheirso827 4 ปีที่แล้ว +3

    *haha yanderedev joke go brrrrrrrrr*

  • @greenin5537
    @greenin5537 ปีที่แล้ว +5

    "This is my life now" what a great line for the beginning of a fun and amazing journey that helped a lot of people to introduce them into programmming me included :D

  • @MurpoHD
    @MurpoHD 8 ปีที่แล้ว +36

    hey man thank you so much for making these videos! youre enthusiasm is great :)

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +10

      +MurpoHD thank you for watching!

  • @bdr420i
    @bdr420i 5 ปีที่แล้ว +14

    ⏸️ You know he's a badass when he says this is a disaster and still make it work like a boss. 👌🏽😁 Genius

  • @dianeonanywhere720
    @dianeonanywhere720 ปีที่แล้ว +6

    Thank you. 7 years later, I am still getting tons of help from this video. Really appreciate it. You are the one I get to focus the most.

  • @erinlewis6901
    @erinlewis6901 5 ปีที่แล้ว +11

    I will never go and watch the redone vidoes of this. These uncut vidoes are amazing and make my MAGD class so much easier and entertaining

  • @bamkparto
    @bamkparto 7 ปีที่แล้ว +25

    void setup () {
    size(600, 600);
    background(0);
    }
    void draw() {
    background(0);
    if ((mouseXheight/2)) {
    fill (255, 0, 0);
    rect(width/2, height/2, width/2, height/2);
    } else if ((mouseXheight/2)) {
    fill (0, 255, 0);
    rect(0, height/2, width/2, height/2);
    } else if ((mouseX>width/2)&(mouseY

    • @mumberthrax
      @mumberthrax 6 ปีที่แล้ว

      I've been sort of following along with these videos using lua and love, and rather than doing a chain of if/elseif blocks, i did this which i think is somewhat prettier:
      function love.load()
      [...]
      quadranttable = {
      {x=0, y=0, w=width/2,h=height/2,qcolor={255,0,0}},
      {x=width/2, y=0, w=width/2,h=height/2,qcolor={0,255,0}},
      {x=0, y=height/2, w=width/2,h=height/2,qcolor={0,0,255}},
      {x=width/2, y=height/2, w=width/2,h=height/2,qcolor={255,255,0}}
      }
      end
      function love.draw()
      [...]
      for i,v in ipairs(quadranttable) do
      if mouseX > v.x and mouseX < v.x+v.w and mouseY > v.y and mouseY < v.y+v.h then
      love.graphics.setColor(v.qcolor)
      love.graphics.rectangle("fill",v.x, v.y, v.w, v.h)
      break
      end
      end
      end
      a little bit different than processing, and i cut out irrelevant lines just for illustation, but i feel like it's more organized (even though it's doing basically the same thing). Not yet sure how to do such tables/arrays in processing...

    • @guerreronikelaos2838
      @guerreronikelaos2838 4 ปีที่แล้ว

      not the he hero we desserve, but the hero we need.

    • @guerreronikelaos2838
      @guerreronikelaos2838 4 ปีที่แล้ว

      @@mumberthrax not the hero we desserve, but the hero we need reloaded 2.0

  • @gardeniachan8780
    @gardeniachan8780 4 ปีที่แล้ว +3

    How to make a Yandere Simulator game like Alex

  • @nojusticeanywhere
    @nojusticeanywhere 5 ปีที่แล้ว +7

    I really appreciate these longer videos. I feel like I need long explanations to why things work.

  • @BerserkersBallistics
    @BerserkersBallistics 6 ปีที่แล้ว +8

    As much as I am learning in these video I watch them mostly to see how awkward he is at the end 😂😂😂

    • @BerserkersBallistics
      @BerserkersBallistics 6 ปีที่แล้ว

      But in all honesty, I've been watching the JavaScript and these ones for about a week now. Thank you so much for them!

  • @John3K21
    @John3K21 5 ปีที่แล้ว +5

    6:52 This video helped a TON. Reordering my statements from greatest to least for my valNum was what I was missing. Not gonna lie, the fact that you were all over the place with this video actually is what helped it all make more sense. Haha. exactly what I needed to understand it all. I just finished rewriting a price calculator in JS for my business that I wanted a number of contingencies on .

  • @dalenassar9152
    @dalenassar9152 7 ปีที่แล้ว +15

    I also think this somewhat "un-preparedness" helps beginners more effectively--it shows we're all human. Watching HIGHLY rehearsed tutorials is just missing that touch!

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +3

      Thanks for this nice feedback!

  • @payjay
    @payjay 2 ปีที่แล้ว +1

    I'd argue that editing out all your stumbles wouldn't give our dumb brains enough time to create the new neural networks you're helping us create.

  • @user-yq8xh
    @user-yq8xh 6 ปีที่แล้ว +1

    You don't need else if. Simply erase the background before drawing the rects. This worked for me perfectly:
    void draw() {
    background(0);
    if (mouseX>100) {
    background(0);
    fill(255, 0, 0);
    rect(300, 100, 50, 50);
    }
    if (mouseX>200) {
    background(0);
    fill(0, 255, 0);
    rect(300, 200, 50, 50);
    }
    stroke(255);
    line(100, 0, 100, height);
    line(200, 0, 200, height);
    }

  • @harrymack3565
    @harrymack3565 5 ปีที่แล้ว +7

    3:24, look at his shirt lol

  • @alliedhero1067
    @alliedhero1067 5 ปีที่แล้ว +4

    I'm doing a processing class at uni at the moment and our lecturer is really awful. I can't thank you enough for these videos + your textbook because they're literally the reason I'm still keeping up in this class. You're such a brilliant teacher and as other people have said, your nervousness and enthusiasm are what make these videos so fun to watch and it's obvious that you genuinely want us to be able to learn. So please don't change!

  • @coffeeoutlaws7783
    @coffeeoutlaws7783 6 ปีที่แล้ว +4

    best explanation of this that i have seen on youtube, thanks a lot. you said it should be 3 min video, but thats bullshit! cause i got it best how you did it

  • @corykilpatrick1175
    @corykilpatrick1175 6 ปีที่แล้ว +4

    PLEASE DO NOT EDIT THESE OR CHANGE ANYTHING EVER

  • @Bryan-tk7il
    @Bryan-tk7il 7 ปีที่แล้ว +7

    Done :D
    void setup () {
    size(640,360);
    background(255);
    }
    void draw() {
    //if statements
    if (mouseX180) {
    background(255,0,0);
    }
    else if (mouseX180) {
    background (0,0,255);
    }
    else if (mouseX>320 && mouseY

    • @Lanr1s
      @Lanr1s 7 ปีที่แล้ว +1

      nope. You did all the backgroung instead of a section

    • @Bryan-tk7il
      @Bryan-tk7il 7 ปีที่แล้ว

      Here is an update :D thanks for correcting, i'm kinda new in learning how to code.
      void setup() {
      size(640,360);
      rectMode(CENTER);
      }
      void draw() {
      background(255);
      stroke(0);
      line(width/2,0,width/2,height);
      line(0,height/2,width,height/2);
      //if statements
      //if statements
      if (mouseX180) {
      fill(255,0,0);
      rect(480,270,width/2,height/2);
      }
      else if (mouseX180) {
      fill(0,0,255);
      rect(160,270,width/2,height/2);
      }
      else if (mouseX>320 && mouseY

    • @Lanr1s
      @Lanr1s 7 ปีที่แล้ว

      nice. I'm new here too.

    • @Lanr1s
      @Lanr1s 7 ปีที่แล้ว

      I'm actually programming at the moment xD. Creating kind of ping pong game while these videos playing in the backgroung

    • @Lanr1s
      @Lanr1s 7 ปีที่แล้ว

      Bryan, wanna share some codes ?

  • @BearFulmer
    @BearFulmer ปีที่แล้ว +2

    I'm so excited to have found this series. Such great work. Thanks

  • @baige5159
    @baige5159 8 ปีที่แล้ว +10

    You are doing really good,and we learned a lot from your videos. If you are tired,get a rest and don't push yourself too much. Thank you very much and We love you~

  • @weltraumimport
    @weltraumimport 7 ปีที่แล้ว +2

    you could really notice how tired daniel was in that video but he kept being motivating and it's amazing how well it works! Thanks for all these videos man

  • @allenwalker604
    @allenwalker604 7 ปีที่แล้ว +2

    Solved a year later because I'm watching your videos atm, keep up the good work, tysm for the explanations!!!
    void setup () {
    size (400,400);
    rectMode(CORNER);
    }
    void draw () {
    background(0);
    if (mouseXheight/2){
    fill(255);
    rect(height/2,width/2,height,width);
    }
    stroke(255);
    line(0,width/2,height,width/2);
    line(height/2,0,height/2,width);

    }

  • @diagram_girl
    @diagram_girl 4 ปีที่แล้ว +2

    I have to learn Processing very quickly for a new job. I'm so happy that I stumbled upon this video series! You've broken everything into chunks that are small and clear enough to digest while building upon each other. No easy feat. You are an excellent teacher and I can't believe these videos are free. So excited to keep going with this tutorial!

  • @juliamigliorini3347
    @juliamigliorini3347 6 หลายเดือนก่อน

    Exercise:
    void setup () {
    size (800, 800);
    }
    void draw() {
    background(0);
    if (mouseX < width/2 && mouseY < height/2) {
    rect(0, 0, width/2, height/2);
    } else if (mouseX > width/2 && mouseY < height/2) {
    rect(width/2, 0, width/2, height/2);
    } else if (mouseX < width/2 && mouseY > height/2) {
    rect(0, height/2, width/2, height/2);
    } else if (mouseX > width/2 && mouseY > height/2) {
    rect(width/2, height/2, width/2, height/2);
    }
    stroke (255);
    line (0, height/2, width, height/2);
    line (width/2, 0, width/2, height);
    }

  • @aishwaryasingh8500
    @aishwaryasingh8500 5 ปีที่แล้ว +1

    I don't know whether you'd scroll that much down to read my comment, but still...
    You are just nailing the teaching process. Everything seems so easy now when a month ago programming was a nightmare for me.
    Thanks a lot. Keep adding videos, keep teaching, keep being nervous. It suits you. 😂😂😂

  • @gawni1612
    @gawni1612 2 ปีที่แล้ว +1

    did you ever remake all these?

  • @exoticpoker3031
    @exoticpoker3031 4 ปีที่แล้ว +1

    How do you fight the ender dragon in Minecrwaft

  • @lauftt
    @lauftt 8 ปีที่แล้ว +4

    this was hilarious lol your videos are very helpful!

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +3

      thank you so much, i'm very glad to hear!

  • @utkarshgupta9517
    @utkarshgupta9517 4 ปีที่แล้ว

    MISSION ACCOMPLISHED !!!
    void setup() {
    size(600, 600); background(0);
    }
    void draw() {
    if (mouseX300){
    background(225,0,0);
    }
    if (mouseY>300){
    background(0,225,0);
    }
    if(mouseX>300 && mouseY>300){
    background(0,0,225);
    }
    stroke(225);
    line(300, 0 ,300, height);
    line( 0 , 300 , 600, 300);}

  • @kevnar
    @kevnar 6 ปีที่แล้ว +2

    He's the Bill Nye of coding.

  • @tonytucker101
    @tonytucker101 5 ปีที่แล้ว

    Here's what I came up with...
    void setup() {
    size(500, 500);
    background(0);
    }
    void draw() {
    if (mouseX < 250) {
    background(0);
    }
    else if (mouseX > 250){
    background(255,0,0);
    }
    if (mouseY > 250){
    background(0,255,0);
    }
    if ( mouseX < 250 && mouseY > 250){
    background(0,0,255);
    }
    stroke(255);
    line(250, 0, 250,500);
    line(0,250,500,250);
    }

  • @inventsable
    @inventsable 7 ปีที่แล้ว

    void setup() {
    size(500, 500);
    }
    void draw() {
    background(0);
    if (mouseX>250 && mouseY>250) {
    rect(250,250,250,250);
    } else if (mouseX>250 && mouseY>0) {
    rect(250,0,250,250);
    } else if (mouseX>0 && mouseY>250) {
    rect(0,250,250,250);
    } else if (mouseX>0 && mouseY>0) {
    rect(0,0,250,250);
    }
    stroke(255);
    line(250,0,250,height);
    line(0,250,width,250);
    }
    //Thank you

  • @edwardfabian7739
    @edwardfabian7739 4 ปีที่แล้ว +1

    i really like the dance @ 5:49

  • @mohamedromdhani1545
    @mohamedromdhani1545 8 หลายเดือนก่อน

    Mr Daniel, you are fantastic. I appreciate that you share your knowledge and experience with us. I enjoy your channel and follow you from Tunisia.

  • @zibbazabba905
    @zibbazabba905 3 ปีที่แล้ว +1

    I came here trying to find out how if else was grouped together, got the nugget 11:11 "with an if statement we can also have an else-"

  • @Deepyantiadvani
    @Deepyantiadvani 8 หลายเดือนก่อน

    Omg you are such a saviour, i was struggling with processing had to submit a pong game with no code experience ever. The video lectures given were soo bad i couldnt figure out stuff but this video is a saviour, thankss alot!

  • @graciousventure
    @graciousventure 3 ปีที่แล้ว

    You looks like
    DJ ALOK
    OF FREE FIRE

  • @gntlmnwzrd
    @gntlmnwzrd 6 ปีที่แล้ว +1

    I love this video, it helped me understand the else if conditional better and the way the video played out made me chuckle a bit

  • @Ok-mb3wd
    @Ok-mb3wd 4 ปีที่แล้ว +1

    Thnx great video, I have a test about this next week. It helped a lot😊

  • @thecrap2
    @thecrap2 9 ปีที่แล้ว +1

    Hi Daniel. These videos are awesome! I like your way at teaching! I am taking an processing course at uni in denmark at the moment, and i have a hard time keeping up in class. These videoes really teaches me how to get things done.
    I have one question though: Is there a part missing in this? I am about to do the excersise with the 4 quadrants. And I need to get this right: I have to paint each quadrant in the respective color? Red, green, blue and purple for instance. Or just the entire background, according to where my mouse is?

    • @thecrap2
      @thecrap2 9 ปีที่แล้ว

      +Daniel Shiffman Thank you for the quick answer! I managed to do this as described :) I am looking forward to learn MUCH more from you, so keep up! :)

  • @rafewhasanmasoodfew8440
    @rafewhasanmasoodfew8440 ปีที่แล้ว

    There were times in this video where I thought my man here is going to explode...

  • @beks2185
    @beks2185 9 ปีที่แล้ว +6

    I am understanding a little more about this subject by watching the videos. You are good. But stop apologizing, don't go off topic. Thats how my professor teaches and it is very confusing. You are good and we need you.

    • @carolinas5132
      @carolinas5132 9 ปีที่แล้ว +7

      +Daniel Shiffman wahhh! not true. I laugh all the time! haha

  • @lidakmify
    @lidakmify ปีที่แล้ว

    Still laughing with this video! You are awesome!

  • @Hardatyou
    @Hardatyou 6 ปีที่แล้ว +1

    10:55 You just made the windows 10 logo real, several days before it was released :O

    • @Hardatyou
      @Hardatyou 4 ปีที่แล้ว

      SuperLolMine my bad, I skipped windows 8 cause the optimization issues

  • @joziel3664
    @joziel3664 5 ปีที่แล้ว

    // Chalenge 5.2
    void setup() {
    size(720, 480);
    }
    void draw() {
    background(50);
    // Layout
    line(width/2, 0, width/2, height);
    line(0, height/2, width, height/2);
    //Logic
    if (mouseX height/2) {
    fill(255, 255, 0);
    rect(width/2, height/2, width/2, height/2);
    }
    }

  • @arnaud2662
    @arnaud2662 6 ปีที่แล้ว

    void setup() {
    size(640, 360);
    }
    void draw() {
    background(255);
    if (mouseX < width/2 && mouseY < height/2) {
    fill(255, 0, 0);
    rect(0, 0, width/2, height/2);
    } else if (mouseX < width/2 && mouseY > height/2) {
    fill(0, 0, 255);
    rect(0, height/2, width/2, height/2);
    } else if (mouseX > width/2 && mouseY < height/2) {
    fill(0, 255, 0);
    rect(width/2, 0, width/2, height/2);
    } else if (mouseX > width/2 && mouseY > height/2) {
    fill(225, 240, 0);
    rect(width/2, height/2, width/2, height/2);
    }
    line(width/2, 0, width/2, height);
    line(0, height/2, width, height/2);
    }

  • @B20DTH
    @B20DTH 3 ปีที่แล้ว

    Well this exactly how it should be taught.

  • @iagowonders
    @iagowonders 6 ปีที่แล้ว

    void setup() {
    size(400, 400);
    }
    void draw() {
    background(0);
    if ((mouseXheight/2) {
    fill(250, 255, 0);
    noStroke();
    rect(width/2, height/2, width/2, height/2);
    }
    }

  • @lydericmokoko115
    @lydericmokoko115 3 ปีที่แล้ว

    void setup() {
    size(640,360);
    }
    void draw(){
    background(0);
    if(mouseX < 320) {
    background(0);

    }
    else if(mouseY > 180 ) {
    fill(0,255,0);
    rect(320,180,320,180);

    }
    stroke(255);
    line(320, 0, 320, height);
    line(0, 180, width,180);

    }

  • @nickbarry659
    @nickbarry659 6 ปีที่แล้ว

    void setup() {
    size(640, 360);
    rectMode(CORNER);
    }
    void draw() {
    background(0);
    if (mouseXheight/2) {
    fill (164, 169, 172);
    rect(320, 180, width/2, height/2);
    }
    stroke(255);
    line(320, 0, 320, height);
    line(0, 180, width, 180);
    }

  • @davideberweger2936
    @davideberweger2936 6 ปีที่แล้ว

    void setup() {
    size(1290, 720);
    }
    void draw() {
    background(0);
    stroke(255);
    line(width/2, 0, width/2, height);
    line(0, height/2, width, height/2);
    if (mouseYwidth/2) {
    rect(width/2, 0, width/2, height/2);
    } else {
    rect(0, 0, width/2, height/2);
    }
    } else {
    if (mouseX>width/2) {
    rect(width/2, height/2, width/2, height/2);
    } else {
    rect(0, height/2, width/2, height/2);
    }
    }
    }

  • @baphnie
    @baphnie 4 ปีที่แล้ว

    idk if you see comments posted to videos years later, but in re-watching your older content I have to say how glad I am that you pushed through your early insecurities and self-doubt to develop your content here. It's relatable, inspiring, and endearing. Keep on!

  • @juancarlosrestreposaldarri2386
    @juancarlosrestreposaldarri2386 7 ปีที่แล้ว

    Hello, look at this :
    int circleX = 0;
    int velocidad = 2;
    boolean control = true;
    boolean Adelante = true;
    boolean Atras = false;
    int MaxX = 500;
    int MinX = 90;
    void setup() {
    size(640, 360);
    circleX = MinX;
    }
    void draw() {
    background(50);
    fill(130,50,85);
    if (control == Adelante) {
    if (circleX < MaxX) {
    circleX = circleX + velocidad;
    } else
    control = Atras;
    }
    else if ( circleX > MinX) {
    circleX = circleX - velocidad;
    }
    else {
    control = Adelante;
    }
    ellipse(circleX, 180, 25, 25);
    println("CircleX : " + circleX + " Control : " + control);
    }

  • @drayeki2647
    @drayeki2647 4 ปีที่แล้ว

    hi, can someone please explain to me why this isnt working, ie why doesnt it react on the mouse movement, but it just appears there as such? i dont understand!!! :(
    (ive seen some other people posting similar code but with ELSE, so Ive tried that too (still not working), but I think its not necessary in this case because of &&, like, its exclusive command (correct me if wrong pls)).
    void setup ()
    {
    size(500, 500);
    }
    void draw()
    {
    background(0);
    if (mouseX >250 && mouseY>250);
    {
    fill (255, 100, 0);
    rect (250, 250, 250, 250);
    } if (mouseX >250 && mouseY

  • @mariagkolemi6880
    @mariagkolemi6880 5 ปีที่แล้ว

    Before I dove into this, I already knew Python, C, C++ and some JavaScript. Well, this is 100000 times more fun than anything I did in any other language (and I did do some pretty fun stuff like Langdon's ant in C++). It's super easy, and super fun. I skip some parts of the videos cause I already know stuff like if's and loops and it get kinda boring after you hear the syntax of "if" for the 4th time in a year, but YOU ARE SUCH AN AMAZING TEACHER that I feel a bit guilty for skipping. Even my friend who hates programming (he was so angry during our C course at university he wanted to smash the screen) gave this a go and loved it. Thank you for making programming so easy for everyone!

  • @zuckirosenfuchs5441
    @zuckirosenfuchs5441 4 ปีที่แล้ว

    Nice video! BUT WATCH THE NEXT VIDEO BEFORE DOING THE EXCERISE. IT MAKES IT MUCH EASIER. (atleast for me :))

  • @999nico
    @999nico 6 ปีที่แล้ว

    Those rectangles and CSS stuff makes me really confused. Can you find easier exmples in order to explain IF/ELSE statements?

  • @carolinamattos2009
    @carolinamattos2009 8 ปีที่แล้ว

    Please DO NOT redo any of these videos! They are amazing, and real fun to watch, I´ve learned so much!! Marry me Daniel!

  • @ACE-qd3sw
    @ACE-qd3sw ปีที่แล้ว

    I love the human touch of these videos, our professors feel like robots teaching us, these kind of videos make it much more enjoyable to learn

  • @AriDalton
    @AriDalton 8 ปีที่แล้ว

    It is great to see the common mistake first then the correct way so that you see how the logic flows in proper order. I like the visual obviousness that Processing gives you when you make these mistakes, in plain old Java it can be a bit less visually obvious.

  • @TheNaruta96
    @TheNaruta96 4 ปีที่แล้ว

    I would have never thought that processing could be fun... before watching your video!! :D

  • @theonetrueacorn4083
    @theonetrueacorn4083 7 ปีที่แล้ว

    i liked the video i think you explain everything perfectly, and the things you don't explain persuade me to go out and look it up myself.

  • @alyanali2314
    @alyanali2314 4 ปีที่แล้ว

    i am at 5:18 of the video and he has asked me to pause the video. WHYYYY u do me like that. Now i don't know if i should resume the video or not.

  • @ЛюбаМазнова
    @ЛюбаМазнова 2 ปีที่แล้ว

    I like that you explain things the way that i explain things (that are interesting to me) :D

  • @YouKnowImOnMyPeriodYah
    @YouKnowImOnMyPeriodYah 3 ปีที่แล้ว

    This video IS Yandere Sim code

  • @TheFourkingluigi
    @TheFourkingluigi 2 ปีที่แล้ว

    im glad these videos are longer than you'd like. you take the time to explain the topic in depth.

  • @agboorohussein4726
    @agboorohussein4726 5 ปีที่แล้ว

    pls, under what consideration did he declare the variable "mouseX"

  • @jamesun25
    @jamesun25 7 ปีที่แล้ว

    i hate programming, i went from learning on Kahn academy and now my mind hurts.

  • @bangdone3616
    @bangdone3616 5 ปีที่แล้ว

    The video seems to get cut off at the end does anyone know where i can find the rest of the information?

  • @pandakso3365
    @pandakso3365 4 หลายเดือนก่อน

    If
    Else
    Or, else 👊

  • @joelhockin281
    @joelhockin281 6 ปีที่แล้ว

    thank you so much for these videos, its making coding really fun for me

  • @evagagreel7974
    @evagagreel7974 2 ปีที่แล้ว

    thank you man! love!!!

  • @yousufalansary3521
    @yousufalansary3521 5 ปีที่แล้ว

    hey man the "else"part got cut off and i couldn't understand it from other sources.
    would really appreciate help thanks

    • @leonlyan8953
      @leonlyan8953 4 ปีที่แล้ว

      else statement will execute, if all the above statements are false!

  • @maximiliangietz7610
    @maximiliangietz7610 10 หลายเดือนก่อน

    Need that Shirt :D

  • @tonytoons9301
    @tonytoons9301 28 วันที่ผ่านมา

    Nerd

  • @andrewdown6406
    @andrewdown6406 5 ปีที่แล้ว

    gracias!!!!! sos lo más!!!! THANK YOU; YOU ARE THE BEST

  • @csk2616
    @csk2616 4 ปีที่แล้ว

    My eyes heart with the bright purple blue screen hahahahahahahahahahah

  • @robertwilson7731
    @robertwilson7731 6 ปีที่แล้ว

    Tobacco smoking is the most common cause of COPD

  • @naraugh1
    @naraugh1 8 ปีที่แล้ว

    Also I have to say, I've mostly been just watching the tutorials required for a class (though I may end up watching your entire series based on my previous comment), and I did not realize the existence of && so while I actually successfully completed the task, mine has MANY more lines of code ha ha.
    void setup() {
    size(600,600);
    background(0);
    strokeWeight(1);
    stroke(175);
    }
    void draw() {
    line(300,0, 300,600);
    line(0,300, 600,300);
    if(mouseX > 300) {
    if(mouseY > 300) {
    fill(255,0,0);
    rect(300,300, 300,300);
    fill(0);
    rect(300,300, -300,-300);
    rect(300,300, -300,300);
    rect(300,300, 300,-300);
    }else {
    if(mouseY < 300) {
    fill(0,255,0);
    rect(300,300, 300,-300);
    fill(0);
    rect(300,300, 300,300);
    rect(300,300, -300,-300);
    rect(300,300, -300,300);
    }
    }
    }else {
    if(mouseX < 300) {
    if(mouseY < 300) {
    fill(0,0,255);
    rect(300,300, -300,-300);
    fill(0);
    rect(300,300, 300,300);
    rect(300,300, -300,300);
    rect(300,300, 300,-300);
    }else {
    if(mouseY > 300) {
    fill(255,255,0);
    rect(300,300, -300,300);
    fill(0);
    rect(300,300, -300,-300);
    rect(300,300, 300,-300);
    rect(300,300, 300,300);
    }
    }
    }
    }
    }