Coding Challenge #32.1: Agar.io - Part 1 (Basic Game Mechanics)

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ม.ค. 2025

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

  • @richjoshuaalzate660
    @richjoshuaalzate660 ปีที่แล้ว +28

    6 years ago, this video inspired me to be a developer. Now, I'm a software engineer in the Netherlands with six years of experience. Thanks, Dan!

    • @fumetsu-950
      @fumetsu-950 ปีที่แล้ว +1

      that is incredible! can you share some projects you are currently working on? i would love to hear about it!

  • @KabooM1067
    @KabooM1067 8 ปีที่แล้ว +233

    I love how energetic you are!
    Watching people code would almost always put me to sleep after a few minutes. You manage to keep it interesting throughout. Good job! I love this series.

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

      puru
      hmm seeing interesting codes > interesting coder
      It's good that we have both here.

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

      JoJo BlowJo
      Seeing interesting code in my own time and reading it and understanding it is different from having to sit through a video of sleepy monotone sounding people explaining it lol. That's why someone like Daniel is such a breath of fresh air.

    • @stonecat676
      @stonecat676 8 ปีที่แล้ว +1

      haha i get what you mean, the monotone guys

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

      Nope you love tseries 😂

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

      @@atanki5682 What?

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

    Never had I realized most than now how relatively little are my problem-solving skills at coding. Dan, you're magic.

  • @Surfurplex
    @Surfurplex 8 ปีที่แล้ว +18

    I have been working a lot with low-level C lately and every time you throw functions like setMag and dist in my face I feel a sting of envy. High-level programming can be a breeze sometimes! Excellent video series :)

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

      feel this so hard

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

      I'm new to programming and feel ashamed of the functions i get to use sometimes...

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

      0Im new to programming and i dont even understand what an Array is. You should feel proud that u are able to write ! Im envy :3

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

      Acedia I always thought arrays were useless

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

      @@Tin98Tin There's this sort of full-circle effect that can happen as you learn about programming (which by now I'm sure you've made plenty of progress in given how long ago this comment was posted) where there is that sense of shame in being able to do things so easily. It's only after you use some of those lower-level languages and have to learn about and make use of more abstract approaches to problems that you really start to understand what people are talking about when they say that different languages serve different purposes. For the most part, all of the stuff Dan does is a great fit for Javascript because of the ease of graphics manipulation and the lack of necessity for optimizations in performance. But on the other hand, something simple like a program to automate the installation of a different program is better left to the lower-level stuff (best not to face a problem more overly-equipped than what's needed).
      All this to say that what you said really resonates with my experience, and I hope by now you've observed that it's 1) completely normal to feel that way and 2) not something you have to bother yourself with. So long as you've got the knowledge needed to solve the problem as efficiently as is necessary, there's really nothing to be ashamed of, regardless of what those circumstances might entail.

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

    1:30 'What's your Victor, vector?' Haha, nice reference to Airplane!

  • @robertcoyle1532
    @robertcoyle1532 8 ปีที่แล้ว +323

    You need to wear a much wider (green only) head band, so we can much easier see your thoughts. Also might be cool to also wear a green collar.
    Seriously... keep um coming... love that code!

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

      haha, indeed.

    • @bemerbemer639
      @bemerbemer639 8 ปีที่แล้ว +1

      +Daniel Shiffman pls make a smooth agario extension

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

      +bemer bemer yesssss

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

      Same thoughts here :D

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

      that would be hilarious

  • @vincentl9562
    @vincentl9562 8 ปีที่แล้ว +46

    Great Video! you make really interesting videos. Keep it up :)

  • @CinnamonRobins
    @CinnamonRobins 8 ปีที่แล้ว +40

    It is awesome how interesting you make coding hahaha, seriously, i couldnt have imaginated seen a video of someone writing code could be so entertaining :D
    (Also i dont know a shit about programming haha but thanks to you i really want to learn :D )

  • @mrdoner3451
    @mrdoner3451 8 ปีที่แล้ว +34

    damn this man is a genius. i wish i had 10% of his js knowledge

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

      Thanks for watching!

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

      pee gee - You can, just watch his videos!

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

    These videos just makes me happy. Its so awesome to take part of your energy and passion.
    Thank you!

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

    man i don't code but you're so energetic, i need more people like you in my life lol

  • @talonnewton9709
    @talonnewton9709 8 ปีที่แล้ว +1

    Love the P5js framework and you! keep the videos comin

  • @kevnar
    @kevnar 8 ปีที่แล้ว +24

    Instead of just adding the smaller blob's radius to your radius, you should add the areas of the circles. In theory, the circle is gaining the mass of the eaten circle. So instead of blob.r += other.r, you should use a blob.mass variable, do blob.mass += other.mass, and then calculate the radius of the blob based on the mass (or area) which is,
    blob.r = math.sqrt(blob.mass / math.pi)
    Edit: Ah. Apparently you figured that out, but in a more complicated way.

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

      Yes, thanks for the simple explanation!

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

    Daaamnnn that video was fire. Nice work!

  • @non-fateggnog7706
    @non-fateggnog7706 8 ปีที่แล้ว +53

    I dont even code but this is hella entertaining

  • @Kai-gb8cx
    @Kai-gb8cx 8 ปีที่แล้ว

    Just watched 10+ of your videos; It had a similar vibe as my favourite book 'The nature of code', and heck you're the creator of it! You've always inspired me in all my codings. Thank you very much :D and keep up the great work!

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

    I desperately need the next episode. Your video on Websockets and node.js just opened up a million opportunities for my code. Learning how to do this will help me create my own stuff. Thanks for the awesome videos! Your content is very high quality as far as programming lessons go. The same content would be dreadfully boring when delivered by most others you can find online.

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

      Thank you so much, I will try to make the time for the continuation. Feel free to upvote it here: github.com/CodingRainbow/Rainbow-Topics/issues

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

    Just a minor optimisation: you never need to use pi to scale up the blob's radius. Consider,
    new_area = pi * new_radius^2 = pi * old_radius^2 + pi * other_radius^2
    Divide everything by pi and take the square root to get:
    new_radius = sqrt( old_radius^2 + other_radius^2 )
    And thus we have a formula for the new radius with no pi's involved.

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

      your variant does involve sqrt operation though, which is slower than multiplication

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

    you are one of the best code teacher on youtube, don't stop !!!

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

    I don't know anything about code. What is the best way to start learning code? All the "beginner coding" videos just basically talk about what coding and programming means, and what you can do with it. You are the first person I have come across that shows the code and the outcome of it. Keep doing what you are doing!

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

      jordan dont try to learn from this guy, this is advanced stuff and u can take classes in school and online for beginning coding. Also, check youtube for some tutorials

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

    Awesome! Just as always!
    You are my fav. youtuber :D

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

    Another awesome video. Really love your videos :D

  • @jadollaron
    @jadollaron 8 ปีที่แล้ว +1

    your vids made me pick up js again!
    keep it up :D

  • @camelcase9225
    @camelcase9225 8 ปีที่แล้ว +83

    Man you're too good. So jelly.
    slither.io? You did the snake game already, for all intents and purposes, but maybe you can revisit and implement the multiplayer aspect of it.

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

      oh, good idea!

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

      Daniel Shiffman excellent! Can't wait.

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

      @@camelcase9225 are you still waiting?

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

      @@salman4430 yup maybe he is

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

      @@TheCodingTrain I looked that up once but I only saw this vid. Can you (unless you already did) make a beginners guide (main functions, their parameters, etc)?

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

    Dan: "I am the blob!"
    Me: "OH HELL NO!"
    (2 seconds later)
    Me: "Well then, let's continue."

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

    I don't like Javascript, not even a single bit. But I will try this with Godot as soon as I get the time. Awesome vid, man!

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

    It's been 3 seconds and I already fucking love this guy

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

    i jusy started watching your videos yesterday.. Great Work!

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

    It is so hard to me but Im a beginner. This is a fantastic game and video. Im eagerly waiting part 2. Im interested in web sockets. You are my role model in programming!

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

    This is so fun to watch!

  • @andrewmingst1797
    @andrewmingst1797 8 ปีที่แล้ว +1

    I code along to these videos to learn p5 but im having an issue. I just implemented the eats feature and im at 17:00 in the video but everytime my blob eats something it disappears. I cant figure out why and ive been comparing my code to the github and its exactly the same.

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

    Make a T1000 simulator. Near the end of Terminator 2 when the T1000 gets frozen and blown apart, all the little blobs of liquid metal steered toward the nearest other blob, melded together, and repeated until there was only one main blob.
    Then, for fun, you could make it explode again with a mouse click.

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

    I love your videos SO MUCH! Omg

  • @haha-eg8fj
    @haha-eg8fj 8 ปีที่แล้ว

    This is awesome. You are the first man on earth to give a video tutorial on how to make a Agar.io game. I am looking forward to the forthcoming videos. Am I a bit late for this? I tried to make a clone from scratch but I find that using a library like p5.js will probably speed up my development significantly after watching your video.

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

    15:44 Wouldn’t it be easier to simply store internally the blob’s area rather than its radius, and simply use a square root when you display it? Calibrating the sizes means you don’t have to deal with any pi factors, and the eating could be done simply by adding the areas.

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

    "Damn Daniel" ... Love these coding challenges :D

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

    Im so happy. To be an aspiring coder ( i suck and currently failing my courses but still want to try)

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

    Thanks for your great tutorials!
    Why do I het a «ReferenceError: createVector is not defined» at 2:47. I'm working with the p5JS-Editor

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

      Oh! I just renamed the "class" Blob to Blobb and also renamed the instance(?)(first line at sketch.js) and it works now...

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

      @@AdrianDegonda I had the same issue, and renamed it as you said, and it works! Why?

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

      @@C00lestNerd I have no idea :)

  • @gamerguykspmc2019
    @gamerguykspmc2019 8 ปีที่แล้ว +13

    Thanks a lot! Now my friend and I can code our dream: an io game.

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

      hahah, funny.

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

      good luck!

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

      wish you best of luck!
      You might want to check out a faster way:
      github.com/websockets/ws

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

    Very nice! You are so awesome :)

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

    you should do a chain reaction game, where there's a swarm of objects that continuously spawn in from the edge, and when you click, it creates an "explosion" that the other swarm object hit and thus explode, and so on, and so on

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

    I really wish I can program like you and understand it as well as you do. I'm trying to learn java and I'm having a very hard time. You make it look so easy. I get frustrated so many times and it takes me forever to do one simple thing.

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

    Your channel has a great community woah! 264 likes and 0 dislikes! Keep it up :)

    • @Tony-db3ig
      @Tony-db3ig 8 ปีที่แล้ว

      TheInvincibleNinjas first dislike

    • @Tony-db3ig
      @Tony-db3ig 8 ปีที่แล้ว

      not

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

    The new radius can be written as sqrt(other.r^2 + this.r^2) since the PI's cancel

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

    Hi can you make a game like tik tac toe, chess , pinball etc., please
    Or some great 2 player games

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

    Sir it was coming the numbers added are not enough for sequence

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

    I didnt know that a brazilian coded it! Im so proud

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

    I just found the best Chanel on youtube 😍

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

    god damnit Dan, i seriously love you. You better take my love damnit

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

    do you have understandings in android and apk's (applications)

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

    How to make animation on the "corner" while eating ball

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

    The Coding Train, did you already made some kind of cooldowns on javascript?
    Some kind of press a key and do something but if you press again that key before some kind of cooldown (make cooldowns with actual time (seconds or milliseconds)) reach the value 0, but if the that cooldown value is 0 that cooldown wont go even lower but if the key get pressed, it does something again and so on. (would be awesome make quite some cooldowns counting at same time, but still make the canvas and objects being drew).

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

      yes, you need to time things based of how long the program has been running for.
      performance.now() will return how long the game has been running.
      For example, if you want to shoot a bullet only once a second at most:
      var bulletTime = 0;
      if (mousePressed) {
      if (bulletTime < performance.now()) {
      bulletTime = performance.now() + 1000;
      //code that makes a new bullet
      }
      }
      hope this helps!

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

    I have known a game almost the same but more complex, the game is called: "Tasty Planet", you think you can do it with this program and teach us please

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

    you make coding look so easy. Where did u learn to code?

  • @ianmeier3922
    @ianmeier3922 8 ปีที่แล้ว +1

    The green in the middle of his headband you can see through cause of the green screen

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

      ian meier just wanted to say that

  • @Frankie.Frankie.
    @Frankie.Frankie. 4 ปีที่แล้ว

    How much do the square root calculations slow this down?

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

    The Head Band tho

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

    Roger, Roger. What's your vector, Victor? Can I get that clearance, Clarence?

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

    Hey Daniel, do you think you can show us an implementation of a quad tree to improve collision detection performance, or some other similar data structure?

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

      Yes, I would very much like to do this as a topic. upvote here: github.com/CodingRainbow/Rainbow-Topics/issues/144

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

    Awesome vid, but I'm curious.. What do you need to change to make this playable over the internet? Agario has thousands of players? It is perfectly realistic. Are TCP heartbeat updates really fast enough for a totally real-time gaming experience. - Not in a home LAN. There is no UDP ability from browsers. I have access to a Godaddy pro dedicated server, non VPN. I have lots of experience coding Java authoritative RTS servers How does agario do it? Thanks

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

    Awesome video!

  • @crong-crong8002
    @crong-crong8002 7 ปีที่แล้ว

    i want to learn how to code but how are doing this thing how do you know all of that and did you work in making a game. is youtube is your full job??

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

    you forgot to do the mouse thing where the thurther your mouse is from the circle it moves quicker.

  • @thishandleistaken
    @thishandleistaken 8 ปีที่แล้ว +1

    My sketch does not know object 'Blob' when it's code is in another file. Any tips on fixing this?

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

      You have to add a reference to it to index.html. See: th-cam.com/video/Yk18ZKvXBj4/w-d-xo.html (I'm using a different editor in this video).

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

    i'm stating the obvious but just want to say you are really good at coding.

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

    so fun to watch!

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

    did you no blobs.forEach(function(value){});

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

    Sir when I entered blob.show it is coming blob.show is not a function

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

    His head band acts like a green screen at one part XD 3:01

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

    Very interesting and great videos. makes coding fun again, but the code doesn't work at all... its one error after another.. maybe show us how to set up the environment?

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

      Try this playlist! th-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html

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

    Why does the main blob 'judder' when the mouse is held still?

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

    It says:
    Uncaught TypeError: Cannot read property 'show' of undefined (sketch: line 34).
    Line 34 says blobs[i].show.
    What am I doing wrong?

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

      TECHtutorials I didn’t watch the video yet but this means that in blobs[i] at that index there is no object to read

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

      I thought of sth. like this, so i made an if(blobs[i]){} statement around it. I still sometimes get the error.

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

    4:34 And so, the campest of Marvel's supervillains were born!

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

    can u make any other .io games like diep, slither or something like that
    P.S-i subbed :)

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

      slither? probably, diep yes

  • @Kino-Imsureq
    @Kino-Imsureq 6 ปีที่แล้ว

    Dan plz reply! If you are having a performance issue with so much food, you should make an if statement which tests if the food is near you. If it is near you, then you should show it, otherwise you don't show it. I was able to make above 3200 food blobs (well, my for loop will generate width*height/32 food blobs, which means the width and height are 320*320, which is a small window) without the if statement, the performance is trash, but with it, it is good!

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

      Thanks for the suggestion!

    • @Kino-Imsureq
      @Kino-Imsureq 6 ปีที่แล้ว

      I am trying my best to remake agario, however i can't add the server because of something which is impossible to debug, and the solution isnt in google. :( can i show you the singleplayer one alone?

  • @gamerguykspmc2019
    @gamerguykspmc2019 8 ปีที่แล้ว +1

    So p5 has a built in camera? This library seems like a graphics only version of phaser- perfect for multiplayer games where all the game mechanics are on the server :)

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

      For camera stuff take a look at createCapture(VIDEO)

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

      +Daniel Shiffman lol not that kind of camera... A game camera like in unity! P5 is great... I've tried using it, and I was impressed.

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

    I searched in the reference and this splice function was remove, what can I do to have the same effect?

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

    When you're referring to "chat" are you talking about twitch? I'd love to watch you live, no clue where though

    • @89mias
      @89mias 8 ปีที่แล้ว

      he does livestreams on youtube. use the bell on the sub button to get notified of youtube and also on your phone when hes live

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

    Man that fucked me up, you were my ad. I got really confused because there were a ton of circles bouncing around in the background and I thought that I skipped through the video or something.

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

    For detecting if the main blob is eating another one I used: if (Math.sqrt(Math.pow(blobs[i].pos.x-blob.pos.x,2)+Math.pow(blobs[i].pos.y-blob.pos.y,2))

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

    Its safe make games in JS??? I think its really easy to hack, because the variables are client-sided and you can make anything.

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

      Yes, in ANY game that is only client side, you can hack and cheat mercilessly, however, if you use Node.js to host a server, and then do the game logic server-side, the client wont be able to cheat, as long as you make sure that the SERVER is doing the game logic, the client side should only get info from the server and spit it out on the screen.

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

    *"Me, I am de blob!"*
    - Daniel Shiffman

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

    Hey Dan I was following your vid to the letter but the "blob = new blob();" doesn't work. It doesn't work with any of the challenges either btw. I've even copy pasted your github onto a new project and still wont work.
    halp pls

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

      you didn't capitalize the 'b' in new Blob()

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

    How would you go about making the speed of the player inversely proportional to it's size?

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

      blob.speed = 3 * (64/blob.r)
      just remember to set the magnitude of the vel vector to blob.speed

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

    I made this game before this challenge, I win ^_^
    I really like your videos
    keep it up

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

    have you been told that you bifurcated your head due to the green stripe in the rainbow headband?

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

      Yes actually, he has been told

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

    when i do
    function Blob(x, y, r) {
    I cant run it and it says syntax error, maybe missing a semicolon?
    Please help

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

      That is correct, what is the error message?

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

    wish i understood more of this, still fun to watch tho

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

    im new to js from java .. do we need the p5.js library to create canvas and do these other stuff ?

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

      no you don't. You just would have to do write much more lines of code and figure out more stuff yourself and write it more manually

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

    I have 1 problem.
    Everytime I try to execute it I get "blob.show is not a function"
    How do I fix this?

    • @Vinni-2K
      @Vinni-2K 5 ปีที่แล้ว

      Are there any classes / more pde files?

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

    Can I please tell me how do you get your computer screen behind you!??

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

      Sorry. Can u please tell me how do you get your computer screen in the background!!????

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

      Green screen! I will be making a studio tour soon which will explain more.

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

      The Coding Train Thanks for replying! I just found your channel less than a week ago and I'm really loving it! Keep it coming!

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

    l love you videos you actually good you should be over 100000 subscribers

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

    *I have an important question!* What is the exact name of the program you are using?

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

      thank you :)

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

      Andy Sarren visual studios is better

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

    what I have to do in the index.html to link this tow libraries to the page (it dose not work when I do this "")

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

      I have to put a localhoast ? but javascript dont need a localhoast to work !

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

    The newzoom with the lerp function only works one time for me, could anyone help me?

  • @Kino-Imsureq
    @Kino-Imsureq 7 ปีที่แล้ว

    Dan may i improve this? so it doesnt look plain? like random player colors, white background, and spliitting.

    • @Kino-Imsureq
      @Kino-Imsureq 7 ปีที่แล้ว

      oh yes i watched till the end ill inprove it :)

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

      Please do, yes!

    • @Kino-Imsureq
      @Kino-Imsureq 7 ปีที่แล้ว

      argh so hard. i cant easily get it to split :( but i can make it rainbow :)

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

      try making an array for the player so that all their induvidual pieces can be represented as one whole player.

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

      blobs.push (new Blob(width/2,height/2));
      in draw function:
      for (var i = blobs.length - 1; I >= 0; i--) {
      blobs [i].show();
      }

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

    .show isn’t working for me can somebody help me

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

    I failed university cause I am not able to code xD I hated to code after my studies (not really cause I always wanted to learn it but it wont go into my brain >.< that makes me angry about myself) But nevertheless I watched in 2 days a shit load of your videos cause its so insane how you solf this problems and have such fun with what you are doing. That is just impressive. My greatest respect.

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

    Is this p5, or proccessing?

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

    Whenever I speedily see a word "blob", I usually see it as "boob". Lol I'm crazy!