20 minutes in and just realized this was angry birds and no flappy bird
@aryamankejriwal59596 жыл бұрын
I know right? I thought it was flappy bird too for the first couple of seconds!😂
@elvsrbad26 жыл бұрын
He's done flappy bird in another video iirc
@aryamankejriwal59596 жыл бұрын
elvsrbad2 yes, but he’s done sooooo many flappy bird videos that it wasn’t too much of a stretch for him to do another one😂
@toasty74085 жыл бұрын
Holy shit same lol
@konstanty80945 жыл бұрын
"I'm gonna be ising matter.js physics engine" - a bit of overkill if you ask me
@CYXXYC6 жыл бұрын
"it already knows the name bird.js" when it was first file you already made
@xBrOwNeDoG6 жыл бұрын
Once he created bird.js it became a suggested name. Its only once he created the file that it showed. Edit: But I dont doubt that he has done this challenge off camera to make sure he can actually complete it.
@CYXXYC6 жыл бұрын
@@xBrOwNeDoG thats what i said lol
@xBrOwNeDoG6 жыл бұрын
@@CYXXYC lol I didnt think thats what you meant. All good though
@maximgasai13496 жыл бұрын
I laughed so hard at that moment
@bluhb5 жыл бұрын
It was literally the first file he created in this video. No doubt he has done this before to test, but that's not where the suggestion necessarily came from.
@abdulhadilababidi80526 жыл бұрын
41:24 such a weird kiss 😂 you are the funnest tutor on KZbin Keep going!
@Taterzz4 жыл бұрын
i don't even javascript but these videos definitely help me in terms of understanding how to properly break down an issue into a programmable solution. the jovial attitude just makes it more infectious.
@zhabiboss2 жыл бұрын
Him: making a bird.js file Also him after 5 min: IT EXACTLY KNOWS WHAT I AM GONNA CREATE IN ADVANCE
@tejaswanama4 жыл бұрын
I love very much the coding train channel. I learn whole javascript from this channel only.. I thank to this channel to makes me knowledgeable...❤❤
@SimpleCarGuy Жыл бұрын
Amazing presenter, great personality, even better coder and yet, the worse box drawer (that’s proportional and square) I have ever seen! Love the vids!
@simeydotme5 жыл бұрын
So good. The style, attitude and communication are brilliant!
@adamulrich50116 жыл бұрын
Those libraries in your hands are simply OP. Keep it up!
@krimo43426 жыл бұрын
I think the best way for the bird to reach Max speed is to release after test if bird position has reached slingshot point position not just delaying it 100ms, PS: thx for matter.js explanation
@rukna37756 жыл бұрын
the editing at the end of the the video was pretty good and also unexpected.
@xTWiZTED6 жыл бұрын
A solution to dettaching the slingshot would be comparing the circle's x (call it c) value to the slingshot's x (call it s) value. If c > s and mouseReleased, dettach the slingshot.
@morphman866 жыл бұрын
I got a coding challenge for you. You have done a lot of the really, really classic games, and a few modern ones, but I don't think we have seen you make any mid-era classics yet. So my challenge would be Dr. Mario. For the uninitiated, you have a 8x32 grid. At random positions, 3-8 (depending on difficulty) "virus blocks" are placed. Your playing piece will start at the top middle and fall down. The pieces consist of 2 blocks of random colours. You may rotate the piece as it falls, just like in Tetris. Your mission is to match up 4 or more blocks of the same colour, where the "virus block" is part of that chain. Once you do, all blocks in that chain disappears. Once all viruses are gone, you have won. If a piece lands in a way so that one block ends up over the top of the screen, you have lost, just like in Tetris. If a piece land sideways with one block sticking out, and there is no block in the position right below it, the overhanging block will continue to fall, but you no longer have control over it, until it lands on top of another block or the floor. Good luck, fellow programmers!
@sadhlife5 жыл бұрын
now i want to code bomberman in p5
@morphman865 жыл бұрын
@@sadhlife Go ahead. It's all grid-based, so if you watch Coding Train's videos about grids, you'll be halfway there.
@minionbay89825 жыл бұрын
the coding train is the most subbed programming channel on KZbin
@noahburget33235 жыл бұрын
I always watch your videos for motivation in my own code. Thank you so much!
@epicclutchers2334 жыл бұрын
I am a kid and i love watching this guys videos
@vashupandey22124 жыл бұрын
you ara a coding hero
@lapetitemort16666 жыл бұрын
i am learned English to watch your lessons. VERY NICE TANKS YOU!!!!!
@lapetitemort16666 жыл бұрын
Aayush Pokharel oh, yes my level elementary but i am continue learning
@taba19505 жыл бұрын
Missed the chance to call it birdbox challenge. great as always.
@Brahvim3 жыл бұрын
29:46 :D I had this idea in my mind while you were thinking: Let's assume that users are only going to pull the bird towards the left side. If that is the case, then if the bird's x-position is greater than that of pointA (..? ...or whatever is the starting point of the constraint is called!), then we destroy/remove/stop the constraint. Same thing if it's going backwards! Another idea I had while writing/typing (😂👍) literally the last line was to check for the length of the constraint. If the 'spring' of the slingshot/constraint has reached a certain radius from the point/has been extended to a certain length, we store the force gained, and then let go of the constraint...that is, delete it (just like you set it to null). Then we remove all existing forces from the bird (other than gravity of course!) and add the force stored in the last step, back into the body. Pretty sure I accidentally didn't write the last step correctly and my idea is not gonna work xD! But the first one has to work....99 point cardinally infinite 9's guarantee! (I feel so confused about the second method I specified that my brain is going haywire right now...like, what does 'guarantee' even mean!? >:O) ( _please send help_ )
@Hello_There8202 жыл бұрын
(Please Ignore) 25:04
@KongBorup6 жыл бұрын
IMO, a better approach would be to replace the setTimeout controlling the slingshot release with an if statement that checks if the bird has crossed the point on the x-axis where the slingshot is placed.
@joogps5 жыл бұрын
6:30 When he said that I imagined javascript reporting ''Error: Null Pointer Exception (I dunno what ur talkin about)"
@michelangelo33306 жыл бұрын
u r my leader in coding world
@Garry-jj6jh6 жыл бұрын
Thank you for giving us your knowledge and also being so positive😁. Keep up the good work
@Thorou6 жыл бұрын
If you had written it in python, you could've used semicolons as the boxes.
@carterjean6 жыл бұрын
the bird is ‘def’
@shaggiel30993 жыл бұрын
lmaooo
@Robber76 жыл бұрын
You could just check the birds X if its a bit greater than the connection point of the sling (the bird is on the right) it should release. So that way it will only release if it actually moves to the right of the sling. Could also check the speed as well. Like if speed > X and x > slingshot.X + 5 fly()
@hashmitsingh5723 жыл бұрын
thanx for the help , u deserve more subs
@kolliden6 жыл бұрын
Love ur content
@Ubayla6 жыл бұрын
I noticed the "rest length" really seems to be a "min length", because it pushes the object towards the length value. Obviously, that's not the desired behavior. It's especially noticeable at 27:01. All sorts of weird behavior because it's trying to keep the bird at least 100 units away from the pivot point. Was kinda surprised nobody in chat mentioned this.
@jaackotorus55895 жыл бұрын
this is why type="module" is useful, everyone is just tired over worrying over the order of scripts
@oscantes6 жыл бұрын
29:49 Yeah I might, and it would be to compare the x positions of the bird and the point that spring is attached to. When bird.pos.x is higher than that attach point, it would be released. And this way bird will be faster cause you won't be wasting the energy that's left in the spring like you do with the timeout thing.
@DaveBriccetti6 жыл бұрын
Great fun! I'm gonna try Matter with my students. And good to see you naturally using const now.
@TheCodingTrain5 жыл бұрын
Pretty soon I'll be pronouncing GIF with a soft g!
@DaveBriccetti5 жыл бұрын
@@TheCodingTrain Ha ha. If you did that I would be thrilled!
@luismiguelgallegogomez80006 жыл бұрын
This really should be the "Crush the castle with Matter.js" coding challenge
@BrettCooper47026 жыл бұрын
Tank Wars :D
@leandroaraujo42016 жыл бұрын
Wow 139 likes and 0 dislikes atm, btw nice video. It's a pity I've missed the stream
@MaxPicAxe6 жыл бұрын
4:00 "oh look it like knows what I'm going to do in advance" xD
@XGSDEV2 ай бұрын
And doesn't realize he already called it! lol
@XGSDEV2 ай бұрын
He thought that it knew what he was going to type, but the thing is he already called it! (LOLLLLLLL)
6 жыл бұрын
Maybe you could release the bird when it’s position is at the slingshot?
@TimToolman6 жыл бұрын
Pål Oliver Kristiansen agreed, either when the bird is at the slingshot constraint 0 point, or simpler when the x delta changes sign after release ( ie your bird went past the slingshot post)
@joogps5 жыл бұрын
that’s exactly what I thought... looking forward to implement that tomorrow!
@robertlister51925 жыл бұрын
@@joogps anyone get this working be trying this for a while would be much appreciated.
@robertlister51925 жыл бұрын
@@joogps function mouseReleased() { console.log(balls.x) console.log(slingshot.sling.pointA.x) if (balls.x >= slingshot.sling.pointA.x){ slingshot.fly(); } } cant get it to work. Everything is the same I cant get it to spring forward before detaching the constraint it just drops as soon as i release.
@clprackers70935 жыл бұрын
Robert Lister you aren’t constantly checking the x positions... only once when the mouse is released
@nachosacco58715 жыл бұрын
That keyboard sound
@HossynAssghary6 жыл бұрын
Oh rainbow im coding with unity for game this is awesome. I love 🌈
@neelgohel3356 жыл бұрын
Awesome!
@gid95516 жыл бұрын
38:24 "Things have gone really off the rails here!" Heh.
@FalcoGer2 жыл бұрын
whenever you copy and paste code, especially large parts such as at 15:10, it's time for pulling it out and making it it's own function, possibly a parent class member.
@matiasvlevi66475 жыл бұрын
15:36 I don't know why but I had to write " this.body = Matter.Bodies.circle(x, y, r/2); " dividing radius by 2. Is it possible that they updated the way matter.js works and made it the diameter input instead of radius?
@DragonSparks5 жыл бұрын
I feel like your right, but the api still has it as radius, maybe they havent updated the api? I was having the issue of it floating over the ground
@Eniallator6 жыл бұрын
To detach the bird at the right moment, you could also detect when the bird's x position is greater than the slingshot's x position and then when it is, trigger the detachment 🙂
@victorwei60535 жыл бұрын
This method works great when the slingshot is fully charged, but not very effective when slingshot is not very pulled back.
@Eniallator5 жыл бұрын
@@victorwei6053 if you don't pull it back very much, you can't get any more power out of the shot. This is because once the bird's x position passes the slingshot's x position, the slingshot will start to slow the velocity of the bird down and bring it back. It's pendulum physics 😉
@robertlister51925 жыл бұрын
@@Eniallator do you have the code to get this to work having trouble because of the class objects.
@Eniallator5 жыл бұрын
@@robertlister5192 I don't, sorry
@robertlister51925 жыл бұрын
No worries :)
@EENYX6 жыл бұрын
Why u so pro at programing ?? How did u learn that ??
@sergioescobar34686 жыл бұрын
awesome!, you made a great game as few minutes..
@bernardorodrigues88483 жыл бұрын
Super late to the party, I know, but is there a reason not to have the this.body.isStatic in the box constructor, and so when you create a new box you just tell it if it’s true or false?
@alexandrezuppo20954 жыл бұрын
AMAZING 😂😂😂😂😂😂
@atakanakkas25805 жыл бұрын
Good Content you better do more videos like this before those (fast typing) fingers get tired
@YitzharVered6 жыл бұрын
Just remember, pong took him longer.
@micronix18886 жыл бұрын
Good job
@kavyagandhi88394 жыл бұрын
bro you are best
@sajeevanfuels19804 жыл бұрын
Daniel Sir Can you tell me which book should I prefer for javascript coding that includes all the concepts right from variables to physics enjine and everything please tell! :)
@malikd.mcnish64822 жыл бұрын
great vid, how do you setup the presentation of your vidoes (what are the softwares)
@JuanMunoz-th3vn5 жыл бұрын
finally was a HAPPY BIRDS , thanks Dan
@Uhrbfbdb883 жыл бұрын
im learning about kinetic energy and potental energy at school!
@KX365 жыл бұрын
bird's x velocity is maximum when its x position passes the slingshot's x position, so release then.
@sorrychou6 жыл бұрын
👍👍👍厲害!
@KakoriGames6 жыл бұрын
Maybe it would be better to release the bird when its distance to pointA is less than a certain number, that way the bird can get the full momentum before releasing and you don't have to time it.
@carterjean6 жыл бұрын
12:22 *its okay, we can break physics and make a floor*
@minghaoliang43116 жыл бұрын
what about checking the position: when the bird is on the right side of the constraint position, release the sling
@cutipets87066 жыл бұрын
wooow that's amazing
@aryamankejriwal59596 жыл бұрын
Another minor thing was that because the ground was exactly the same size as the screen, any blocks that went partially off screen could be seen falling off the ground
@TheCodingTrain6 жыл бұрын
Ah, yes, that definitely needs to be fixed!
@alefsdev6 жыл бұрын
It would be great if u do the jenga one!
@GuillemRibes-w7y5 жыл бұрын
I actually have an error. In around the minute 19:00 Dan writes code that is able to move the bird object around and toss it. This rarely works for me and it grabs the bird when the cursor isn't even on it! I think that this has to do with the scale but I can't think of anything else, if anybody who has also had this problem or have been able to do this challenge anyway, please help. Thanks
@TheCodingTrain5 жыл бұрын
Oh! Are you on a "high pixel density display" by any chance? Try adding the following: mouse.pixelRatio = pixelDensity();
@adk_884 жыл бұрын
@@TheCodingTrain I had the same problem on a 4k display, this fixed it. Thanks !
@Yufukfu6 жыл бұрын
Just release the bird when distance between the bird and the constraint is less than the initial length
@average-enjoyer76 жыл бұрын
Hi, a big fan of your channel! You have mentioned this project is done in an object orientated manner, I can't help but wonder how would you simulate this in a functional programming paradigm :) Cheers!
@joestevenson55685 жыл бұрын
With great difficulty. OOP is really ideal for graphical and physics problems as they typically revolve around objects. Functional programming is better suited for tasks requiring guaranteed memory and thread safety.
@MrWindboarder4 жыл бұрын
If anyone is having troubles with the mouseConstraint part, you may need to set this parameter if you are on a HD display: mouseConstraint.mouse.pixelRatio = 2;
@tekoreypy5 жыл бұрын
It is a very useful and entertaining video, I just missed the part where the teacher explains than you must run the code from a java server or the browser will not load the images Because the cors system. but it let me learn about Apache and tomcat, so a the end I'm thankful for that too
@TheCodingTrain5 жыл бұрын
More in this workflow series! kzbin.info/aero/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X
@Adam-rt1lc6 жыл бұрын
Bonne vidéo!!!
@xFaull5 жыл бұрын
help 19:00 matter-js: MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected i dont know why but when i type mouse: mouse it doesnt let me move the ball but i figured if i type Mouse: mouse it does but comes up with the warning above
@CodeBlue-le2sf5 жыл бұрын
Same... Did you ever figure it out im just now watchong this?
@ziuhoque15326 жыл бұрын
keep coding challenage
@toxiczappyt59374 жыл бұрын
why is my bird floating
@hedwinbonnavaud69986 жыл бұрын
What about problem: click on equals enemy to move them? :D plz show how to fix it!
@Henkie6 жыл бұрын
bird box? ground
@averagewojak26236 жыл бұрын
:O
@mikkel13836 жыл бұрын
I have tried to find someone say bird box in the chat for a long time, FINALY😂
@unlikelysalmon7866 жыл бұрын
Heya, I was just wondering why you sometimes use function and sometimes use classes when you can just do both with function. Is there a difference, and if so, is it important enough to use both? Edit: great video btw
@DrBlort6 жыл бұрын
Think of OOP as a way to model a problem, which is closer to how we (humans) think. You could resolve all programming problems with just variables, loops, conditionals, and functions (and maybe even without functions), which in the end is how CPUs work. When you model your data and behaviours in classes, you're making it easier for you to think about a solution. A classic example would be to model a car, which has an engine, and wheels, all interconnected, and you can only accelerate, brake, or steer. Otherwise, imagine having a chassis, an engine, and wheels, and having access to their innards, and moving everything with wire and by hand :D
@liamasman6 жыл бұрын
woooo!
@aryamaangoswamy1796 жыл бұрын
Can you do a coding challenge where you create an interactive Rubik's cube? And possibly publish it to the Internet? Also, include a few buttons to make those moves (like an R button, L button etc.).
@TheCodingTrain6 жыл бұрын
Please suggest or upvote here! github.com/CodingTrain/Rainbow-Topics/issues
@melody37414 жыл бұрын
Wait u til mouse press set a flag the flag looks for mouse release and then once that happens it waits until the ball crosses the center point i.e. string is length 0 it releases.
@bhagatvirsindhu48695 жыл бұрын
Hello Daniel, I have a question : I am 13 years old and I'm currently in 8th grade and I will be in 9th grade in April. I have opted for computer science because I love coding a lot and I want to become a software engineer when I grow up. I will be taught processing.py in school. So I decided to learn Java (Processing) and came across your channel. I saw that in your older videos, you taught processing but in the newer videos, you moved to p5.js and you began to do most of the Coding Challenges with p5.js. It made me think whether I should continue to learn Processing or move to p5.js and leave Processing. This is my question - Whether I continue learning Processing or turn to p5.js. Please answer this question as soon as possible. Thanks
@TheCodingTrain5 жыл бұрын
Hi! So glad to hear from you! Maybe this is a disappointing answer, but my answer is. . I have no answer! I think both are great and can have their pros and cons. One reason to use p5.js is that you can run everything in the browser and share easily with friends. But Processing is often faster and you can do more "full screen" things with it as well as interface with hardware and many Processing libraries! Just go with what you enjoy and feel like doing!
@bhagatvirsindhu48695 жыл бұрын
@@TheCodingTrain I feel like doing both, I'll first learn from all of your Processing videos and then I will begin with p5.js because it seems more tempting. Thanks a lot for replying.
@Zxios5 жыл бұрын
Dan, you of all people should know by now that preincrement is superior to postincrement.
@LapSiLap6 жыл бұрын
Nice video! Btw instead of const options = { mouse: mouse} you can just do const options = { mouse}
@WEBSTART-LIVE4 жыл бұрын
спасибо за русские субтитры!)
@χάθηκα2 жыл бұрын
I just can't stop laughing with that bird.js
@VikingCanadian5 жыл бұрын
Can you do the Tower of Hanoi, showing the algorithm's work every step. I would love to see this!! :)
Could you do a video of depolying processing applications on Android? I couldn't get it to work that well unfortunately.
@sonalinichit71563 жыл бұрын
You are cool
@FroyoAnto6 жыл бұрын
you need a shorter drumroll sound.
@mihir89rd6 жыл бұрын
What purpose does pushing and popping in the bird show method serve?
@TheCodingTrain5 жыл бұрын
I explain these concepts in this video: kzbin.info/www/bejne/pWrWmJ2rnZJ2eK8
@boradrutvik42916 жыл бұрын
Hey what soft ware are u using in the video???
@TheCodingTrain6 жыл бұрын
I'm using the p5.js web editor (editor.p5js.org).
@proyas214 жыл бұрын
4:00 lol🤣
@chloewatson72454 жыл бұрын
Hey I tried the code but I am getting an error. And also there was a problem with the swing .Can someone please help me out.
@jydendmonte1903 жыл бұрын
ummm pls i hope u see this anbd answer but my bird has an invisible wall around it not letting me touch the ball wut do i do pls respond to this
@davidbundgaard6 жыл бұрын
I guess the proper way is to calculate the circle distance to start position and when it reaches 0 cut the line.
@EduardsSilins6 жыл бұрын
You should check after releasing mouse when the ball gets to its start position. In that way you will get the best results... :D At least i would do that...
@EduardsSilins6 жыл бұрын
Try this one out... editor.p5js.org/redsky_48/present/PNusb_TyE
@TheCodingTrain5 жыл бұрын
Nice!
@isaidstream45476 жыл бұрын
Hi, is there a library to make online games?
@joogps5 жыл бұрын
isaid stream you should take a look at his videos about websockets :)
@amrantomer80055 жыл бұрын
My collision physics is off. things shoot out in the wrong direction with non realistic momentum. Has someone encountered this problem?
@Troy-ol5fk3 жыл бұрын
I think it would be more realistic to remove the constraint when mouse is released *and* the magnitude/length of the slingshot line equals 0