Coding Challenge #72: Frogger - Part 1

Поделиться
HTML-код
  • Опубликовано: 23 янв 2025

Комментарии • 102

  • @serotoninbeggar9957
    @serotoninbeggar9957 7 лет назад +17

    I've been watching you for a while now, and you are the friendliest most joyful educator I've ever seen and I'm so glad I found this channel

  • @MySisterIsASlytherin
    @MySisterIsASlytherin 7 лет назад +66

    "A frog is a rectangle" -Daniel Shiffman, 2017

    • @MaffeyZilog
      @MaffeyZilog 3 года назад

      "The frog is a square!" ~ Daniel Shiffman, 2017 (2 minutes later)

    • @jimlthor
      @jimlthor 2 года назад

      @@MaffeyZilog All squares are rectangles ;)

  • @sebinot8250
    @sebinot8250 7 лет назад +10

    I was so waiting for an always extending rectangle, because I knew you wouldn't notice before testing :D

  • @JDubz1997
    @JDubz1997 7 лет назад +7

    I've been neglecting your videos lately, I'm glad I'm back :)

  • @tesla5440
    @tesla5440 7 лет назад +12

    best coder i have ever seen.
    and also u have a sense of humor that gives ur channel some taste.
    i hope someday i will be someone like u.

  • @gollumei
    @gollumei 7 лет назад +42

    "If I'm gonna have an opportunity to write 'this.', I'm gonna write 'this.'" - Daniel Shiffman, 2017

    • @tomburris8380
      @tomburris8380 7 лет назад +8

      **then proceeds to not write the 'this.'**

    • @zorkan111
      @zorkan111 7 лет назад

      Except when it's actually needed. Then he omits it.

  • @tahmmyTV
    @tahmmyTV 7 лет назад +4

    It's amazing you got this to 23 minutes from that livestream

  • @hannahkimchi_
    @hannahkimchi_ 4 года назад +1

    these videos give me life thank you so much for your time and effort into these videos:)

  • @Person-tq4xf
    @Person-tq4xf 7 лет назад +1

    I love these coding challenge videos, they are unlike anything I've seen on youtube.
    I am having so much fun despite the fact that I dont understand what is going on...but i am enjoing it...
    IN CONCLUSION: I am going to learn how to code so i can do these fun challenges

  • @dinoswarleafs
    @dinoswarleafs 7 лет назад +60

    Hey Daniel! I'm curious, do you have any plans to show Processing with the Arduino or other external hardware at some point? I would love to watch it to see what fun projects you would do with it

    • @cameronadams4366
      @cameronadams4366 7 лет назад +3

      Dinoswarleaf yeeeeeeees that would be sick

    • @krystianzawadzki975
      @krystianzawadzki975 7 лет назад +3

      Dinoswarleaf That would be neat! Write on his github page :D

  • @laht93
    @laht93 4 года назад

    You're the best, coding challenge person!

  • @jonnylaw4569
    @jonnylaw4569 6 лет назад +8

    I spend 6 hours trying to find some sort of code that can tell me if something is intersecting or not that I can remember fairly easily, give up, click a random video, and there it is,
    Ps-was looking for a simple one just because I'm new to using processing.

  • @DeepFriedOreoOffline
    @DeepFriedOreoOffline Год назад

    This is an interesting way to think about collisions, I have only ever seen it the other way.

  • @asston712
    @asston712 6 лет назад +4

    This dot, this dot, this dot, this dot (music)

  • @marloncendron
    @marloncendron 7 лет назад

    Hi Daniel! I'm learning so much with your videos, but not only about programming, I'm brazilian, my english is bad(you must noticed that), and I'm learning english too. I love your videos, and I've seen much of then, you're a very good teacher, thanks!

  • @ecceaufx3207
    @ecceaufx3207 7 лет назад +1

    Hey man, I love your videos! They are really enjoyable and entertaining! I consumed your serieas about evolutionary/genetic algorithms and loved every part of it! Now that I am getting more into it I would love to see more from you about that topic! Do you think you will go back once and do some more in that series? Keep it up!

    • @TheCodingTrain
      @TheCodingTrain  7 лет назад +5

      I'm planning on revisiting genetic algorithms to evolve neural networks sometime soon!

  • @DeathAtYourDoorStep
    @DeathAtYourDoorStep 6 лет назад

    I love your videos! :) Ty for making them

  • @krystianzawadzki975
    @krystianzawadzki975 7 лет назад

    Finally! Was waiting for this :D

  • @beenbeen130
    @beenbeen130 7 лет назад

    Another great video, Coding Challenge Person RUclips Thing!

  • @willpoweredstudios8529
    @willpoweredstudios8529 7 лет назад

    if you made the rectangle keep track of the center x and y as well as the width and height you could check for intersection like this:
    return ( Math.abs( rect1.x - rect2.x ) < (rect1.width + rect2.width)/2 &&
    Math.abs( rect1.y - rect2.y ) < (rect1.height+ rect2.height)/2) ;
    and save yourself 2 lines. Not that two lines is a big deal, and I don't know how the performance stacks up but I think it's slightly nicer to look at.

  • @QD77
    @QD77 7 лет назад +2

    Hey, why not add left, right, top and bottom as properties (functions? Or whatever they're called) like :
    float right(){return x+w}?

  • @TheTriggor
    @TheTriggor 10 месяцев назад

    The essence of game dev in 20 minutes. 80% boring backend, 20% flashy effects.

  • @kamilbolka
    @kamilbolka 7 лет назад +1

    Great video, like always :D

  • @charbelsarkis3567
    @charbelsarkis3567 7 лет назад

    this is very informative i never knew what extends is and now i know

  • @iceburgs98
    @iceburgs98 7 лет назад +1

    1:00 HE WAS ABOUT TO WIN

  • @codytremblay8986
    @codytremblay8986 6 лет назад +1

    The frog won't be a square when he gets ran over. lol

  • @mauriciodumontrocha4110
    @mauriciodumontrocha4110 4 года назад

    I have a problem, i put the same code, the rectangle only extends and doesn't move

  • @michielwils8401
    @michielwils8401 7 лет назад

    Just love his intro's :D

  • @KerryMeXx
    @KerryMeXx 3 года назад

    I have started creating my own Frogger game differently, but got stuck on the collision so was looking at this for ideas, I have "Entity" instead of "Rectangle" but when I try to do the intersection I get the error "Expected 'Entity', provided 'car'", any idea how to fix this? (car extends entity).

  • @mauriciodumontrocha4110
    @mauriciodumontrocha4110 4 года назад

    Do you know where is the link that includes the JavaScript code?

  • @rameetmashta
    @rameetmashta 7 лет назад

    Is there any video about magnetism?

  • @papinkelman7695
    @papinkelman7695 7 лет назад +1

    the best part is that this. (see what I did there?) that this doen't just show how it is done, it also shows the thought process on why it is done in that way... makes sence?

  • @caleb5688
    @caleb5688 7 лет назад

    I have a suggestion for a coding challenge. I am making a javascript game in p5, and I have got to the point to where I want to try using sprites. Is that something you could show us in p5?? Thx.

  • @daanfrankhuizen6798
    @daanfrankhuizen6798 7 лет назад

    Yo Daniel! What an awesome coding challenge! But I have one question: If I copy your code, Processing is saying the following "the function "move(int,int)" does not exist." What does this mean? He is saying it in the "frogger" folder". Thanks in Advance!

  • @unbelievable3935
    @unbelievable3935 7 лет назад

    sir .. which ide are u used for programming please tell me sir...

  • @junayED.
    @junayED. 3 года назад

    I love that 😍

  • @up4life108
    @up4life108 7 лет назад

    I'd really like to see how to use sprite sheets! Also this video REALLY helped me a lot.

    • @Zoub29
      @Zoub29 7 лет назад

      Not sure if this is exactly what you're looking for, but I've implemented sprites in p5.js : plnkr.co/edit/BZz6Dw

    • @TheCodingTrain
      @TheCodingTrain  7 лет назад

      Great idea!

  • @gharigaming
    @gharigaming 7 лет назад

    What are u programming on

  • @sadhlife
    @sadhlife 7 лет назад +1

    Use switch and foreach for once. i really wanna learn foreach.
    Also when are you making a video on == vs ===?

    • @thelethalclips
      @thelethalclips 7 лет назад

      The difference between == and === is really easy to understand and straight forward. == just checks if the values that are being compared are the same.
      if ("2" == 2)
      console.log('equal')
      // Will output "equal" to cosole
      === checks if the values that are being compared are the same and their data type is the same, so if we were to run the same code but instead of using == we used === it wouldn't log "equal" to the console because both 2's have different data types, one is an integer and the other is a string.

    • @sadhlife
      @sadhlife 7 лет назад

      Oh nice. Is that the only thing? No other clever uses?

  • @ichbinfett428
    @ichbinfett428 7 лет назад

    Which text editor are you using?

    • @iosgamer158
      @iosgamer158 7 лет назад

      he is using Atom for P5.js. for processing he is using the processing editor: processing.org/download/

  • @lookitsanivysaur.3172
    @lookitsanivysaur.3172 7 лет назад

    how tf do you rename sketch_170701?

  • @td2danimation667
    @td2danimation667 7 лет назад

    What program is hi using

  • @taewonkim8042
    @taewonkim8042 7 лет назад +4

    Hey Daniel I love your videos and I am a beginner in python...... so I don't get really get java...... so can u do a coding challenge in python? Thanks! I 'm your #1 fan!!!!

  • @Kim-bi6lb
    @Kim-bi6lb 7 лет назад

    What language is this in? I'm not familiar with coding yet, sorry for my lack of knowledge. And please don't tell me it's in english, thank you.

  • @patrickmolen523
    @patrickmolen523 4 года назад

    Spent way too long figuring out why my character wasn't moving, just to realize that I created a function called keypressed() and didn't actually use keyPressed(). them damn capital letters

  • @LoriWolfcat
    @LoriWolfcat 7 лет назад

    Try to do PokéMoN, or an app called Geomon. I would wanna know how you can code something like that.

  • @imahater9978
    @imahater9978 7 лет назад +2

    Good Video!

  • @TheRabbit18
    @TheRabbit18 7 лет назад

    would this work on p5? Just replace the floats, with vars??

    • @TheCodingTrain
      @TheCodingTrain  7 лет назад

      A bit more than this, but yes. I have a port on github: github.com/CodingTrain/Frogger

  • @nooby02031
    @nooby02031 7 лет назад

    Was I the only one that got upset when he paused Frogger right before he got the last frog :(

  • @640kiboughttobeenough
    @640kiboughttobeenough 7 лет назад

    When I was testing the code on my computer I found that program does not reacting on pressing the keys. Can You help me please?

  • @Ikpoppy
    @Ikpoppy 7 лет назад +1

    99:59:59

  • @nirajgaonkar7669
    @nirajgaonkar7669 7 лет назад

    listening to daniel at 2x speed is still funny

  • @25500
    @25500 7 лет назад

    You could have explaine which ide you're using you know...

    • @TheCodingTrain
      @TheCodingTrain  7 лет назад

      You can try some of these workflow videos:
      sublime text: ruclips.net/video/UCHzlUiDD10/видео.html
      atom editor: ruclips.net/video/d3OcFexe9Ik/видео.html
      brackets: ruclips.net/video/nmZbhManVcY/видео.html
      codepen: ruclips.net/video/5gfUgNpS6kY/видео.html

  • @chris9620
    @chris9620 7 лет назад

    make an ocr engine once :)

  • @user-oj3gb8nh2q
    @user-oj3gb8nh2q 7 лет назад

    inheritance is easy :P

    • @sadhlife
      @sadhlife 7 лет назад +1

      said nobody ever. inheritance and polymorphism is the toughest part of any language. anything tougher is just logic based, not syntax.

    • @user-oj3gb8nh2q
      @user-oj3gb8nh2q 7 лет назад

      inheritance is easy in logic. When it come to syntax, it really has to do with what language you use. C++ syntax is actually pretty easy.
      Polymorphism is not that easy, i agree on that

    • @zackmercurys
      @zackmercurys 7 лет назад

      why not? get a good textbook on your language and voila

    • @user-oj3gb8nh2q
      @user-oj3gb8nh2q 7 лет назад

      c++. any suggestions?

    • @sadhlife
      @sadhlife 7 лет назад +1

      Sudo Hyde herbert schildt any day.

  • @hadikurniawanar7036
    @hadikurniawanar7036 6 лет назад

    Too bad i was watching the fifth frog to finish ☹️

  • @Kim-bi6lb
    @Kim-bi6lb 7 лет назад

    40th!

  • @martlesmartlesmartles
    @martlesmartlesmartles 7 лет назад

    im early!

  • @IDisagreeWithYouAlot
    @IDisagreeWithYouAlot 7 лет назад

    Dude calmmmmmmm downnnnnn brother

  • @lonec1777
    @lonec1777 7 лет назад

    this is what I used for AABB rectangle collision
    boolean cRvR(Rect john, Rect jane){
    if(
    john.x

    • @Nazekmvm
      @Nazekmvm 7 лет назад +1

      > return true;
      else
      return false;
      NO..NOO...NOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    • @lonec1777
      @lonec1777 7 лет назад

      wat

    • @comarmy-ei5hg
      @comarmy-ei5hg 7 лет назад

      just return what is in the if statement, like this:
      boolean cRvR(Rect john, Rect jane){
      return (
      john.x

    • @MrGrimbeorn
      @MrGrimbeorn 7 лет назад

      There is no point i writing:
      else
      return false;

    • @lonec1777
      @lonec1777 7 лет назад

      oh okies :)

  • @ahmednasif5443
    @ahmednasif5443 2 года назад

    you talk too much