I trullt adore how instead of using a github link to share a sourcecode you just copypasted whole script in a youtube comment :D nevertheless, thanks for a wonderful tutorial!
Hey bro I love your channel I have started learning HTML from your 1 hour HTML course , I'm planning on learning CSS and Javascript from your channel after finishing HTML, after Javascipt I will learn Rust programming language, can you make a course on Rust as well ? It would be really great Love from Oman
Olá, a nossa plataforma gostaria de o convidar a anunciar para nós e nós pagaremos pelo seu anúncio, por favor contacte-me se estiver interessado, obrigado"
underrated channel, very fast and daily uploading of a very useful content. thank you so much this is absolutely helpful to me while I am currently learning js
Luckily I started in your java tutorial series when I discovered your channel, javascript has a lot of common format for the syntax. I'm also studying your DS&A tutorial series, and that one is heavily related to both of these two languages that I am learning as well. Hopefully I will finish that DS&A too so that I can go over c# and c++ programming.
Keep up the good work. I really appreciate your content. This copywork and trying to understand it is the best way for me to learn as fast as possible.
Can you please do some tutorials on c# advanced topics like control and connecting to database please? I am a biggest fan i have seen all your videos about swing and now am pro on swing thanks to you bro ✌️✌️
Hey Bro, I’m a big fan of your channel. I just graduated high school and I’m majoring in Computer Science next year. I want to spend the summer coding, but I don’t know where to begin. I’m essentially starting from scratch after taking a course in Python from Udacity. My main interests are working with data and math (I’ve taken multivariable calculus). I’m asking you because I enjoy your detailed content, and I know you’ll have a lot of experience answering these types of questions. I’m looking to learn robust skills and make cool projects and generally avoid being bored. Hope you can help. Thanks.
Hey bro is it possible you make a tutorial about programming phones with android studio after this JS course? (Thanks alot for coming back to youtube).
Hey man! I am a college student, and your tutorials have helped me immensely. Do you have a patreon, or a donation website for us to show our gratitude? I would like to pay you a cup of coffee (or a beer) lol. All this knowledge for free is just crazy! Thank you so much!
Hey dude just asking r u gonna do any c# games and stuff like the rock paper scissors and guess the number ones because they were really fun to follow and learn! Keep the amazing work up!
You are a legend !!!! and a big inspiration. You make coding super easy. Would love to know if you will be doing any content on WEB 3.0...A BIG THING!! Your great knowledge will really go a long way to help us understand all about solidity and building web3 dApps
@BroCodez bro could you please make a project on Sudoku Game In Web Development and in that project there will be different types of level and every new game there is a new game board where the numbers from 1 to 9 will be in random order in random section in every new game and there is a button whose name is solution and when you click on that button you can see the solution of that particular game and every new game the solution button will give the appropriate solution for that game.
9:50 idk why but it doesnt draw the paddle :( anyone can help me? i checked the code, everything checks out but it doesnt draw the paddle. only difference in my code is that i typed "black" instead of whatever colour he chose :(
Hello dude. I just wanma ask if the contents you have in this 90-video playlist is the same with the other playlist containing 60 videos. I just found both of the playlist when I'm looking for your tutorial on javascript.
Hey bro! I want some advice. From u I have learned java and learning javascript but I am one of those guys who suffer from imposter syndrome. so what should I do? if I have to do some example projects can u give me ideas? BTW you make epic videos, keep it up, and best of luck :thumbsup: .
UPDATED (initial ball Y direction is more randomized)
*****************************************************
const gameBoard = document.querySelector("#gameBoard");
const ctx = gameBoard.getContext("2d");
const scoreText = document.querySelector("#scoreText");
const resetBtn = document.querySelector("#resetBtn");
const gameWidth = gameBoard.width;
const gameHeight = gameBoard.height;
const boardBackground = "forestgreen";
const paddle1Color = "lightblue";
const paddle2Color = "red";
const paddleBorder = "black";
const ballColor = "yellow";
const ballBorderColor = "black";
const ballRadius = 12.5;
const paddleSpeed = 50;
let intervalID;
let ballSpeed;
let ballX = gameWidth / 2;
let ballY = gameHeight / 2;
let ballXDirection = 0;
let ballYDirection = 0;
let player1Score = 0;
let player2Score = 0;
let paddle1 = {
width: 25,
height: 100,
x: 0,
y: 0
};
let paddle2 = {
width: 25,
height: 100,
x: gameWidth - 25,
y: gameHeight - 100
};
window.addEventListener("keydown", changeDirection);
resetBtn.addEventListener("click", resetGame);
gameStart();
function gameStart(){
createBall();
nextTick();
};
function nextTick(){
intervalID = setTimeout(() => {
clearBoard();
drawPaddles();
moveBall();
drawBall(ballX, ballY);
checkCollision();
nextTick();
}, 10)
};
function clearBoard(){
ctx.fillStyle = boardBackground;
ctx.fillRect(0, 0, gameWidth, gameHeight);
};
function drawPaddles(){
ctx.strokeStyle = paddleBorder;
ctx.fillStyle = paddle1Color;
ctx.fillRect(paddle1.x, paddle1.y, paddle1.width, paddle1.height);
ctx.strokeRect(paddle1.x, paddle1.y, paddle1.width, paddle1.height);
ctx.fillStyle = paddle2Color;
ctx.fillRect(paddle2.x, paddle2.y, paddle2.width, paddle2.height);
ctx.strokeRect(paddle2.x, paddle2.y, paddle2.width, paddle2.height);
};
function createBall(){
ballSpeed = 1;
if(Math.round(Math.random()) == 1){
ballXDirection = 1;
}
else{
ballXDirection = -1;
}
if(Math.round(Math.random()) == 1){
ballYDirection = Math.random() * 1; //more random directions
}
else{
ballYDirection = Math.random() * -1; //more random directions
}
ballX = gameWidth / 2;
ballY = gameHeight / 2;
drawBall(ballX, ballY);
};
function moveBall(){
ballX += (ballSpeed * ballXDirection);
ballY += (ballSpeed * ballYDirection);
};
function drawBall(ballX, ballY){
ctx.fillStyle = ballColor;
ctx.strokeStyle = ballBorderColor;
ctx.lineWidth = 2;
ctx.beginPath();
ctx.arc(ballX, ballY, ballRadius, 0, 2 * Math.PI);
ctx.stroke();
ctx.fill();
};
function checkCollision(){
if(ballY = gameHeight - ballRadius){
ballYDirection *= -1;
}
if(ballX = gameWidth){
player1Score+=1;
updateScore();
createBall();
return;
}
if(ballX paddle1.y && ballY < paddle1.y + paddle1.height){
ballX = (paddle1.x + paddle1.width) + ballRadius; // if ball gets stuck
ballXDirection *= -1;
ballSpeed += 1;
}
}
if(ballX >= (paddle2.x - ballRadius)){
if(ballY > paddle2.y && ballY < paddle2.y + paddle2.height){
ballX = paddle2.x - ballRadius; // if ball gets stuck
ballXDirection *= -1;
ballSpeed += 1;
}
}
};
function changeDirection(event){
const keyPressed = event.keyCode;
const paddle1Up = 87;
const paddle1Down = 83;
const paddle2Up = 38;
const paddle2Down = 40;
switch(keyPressed){
case(paddle1Up):
if(paddle1.y > 0){
paddle1.y -= paddleSpeed;
}
break;
case(paddle1Down):
if(paddle1.y < gameHeight - paddle1.height){
paddle1.y += paddleSpeed;
}
break;
case(paddle2Up):
if(paddle2.y > 0){
paddle2.y -= paddleSpeed;
}
break;
case(paddle2Down):
if(paddle2.y < gameHeight - paddle2.height){
paddle2.y += paddleSpeed;
}
break;
}
};
function updateScore(){
scoreText.textContent = `${player1Score} : ${player2Score}`;
};
function resetGame(){
player1Score = 0;
player2Score = 0;
paddle1 = {
width: 25,
height: 100,
x: 0,
y: 0
};
paddle2 = {
width: 25,
height: 100,
x: gameWidth - 25,
y: gameHeight - 100
};
ballSpeed = 1;
ballX = 0;
ballY = 0;
ballXDirection = 0;
ballYDirection = 0;
updateScore();
clearInterval(intervalID);
gameStart();
};
Document
0 : 0
Reset
#gameContainer{
text-align: center;
}
#gameBoard{
border: 3px solid;
}
#scoreText{
font-family: "consolas", monospace;
font-size: 100px;
}
#resetBtn{
font-family: "Permanent Marker", cursive;
font-size: 22px;
width: 100px;
height: 50px;
border: 4px solid;
border-radius: 15px;
cursor: pointer;
}
I trullt adore how instead of using a github link to share a sourcecode you just copypasted whole script in a youtube comment :D
nevertheless, thanks for a wonderful tutorial!
❤️
Hey bro I love your channel I have started learning HTML from your 1 hour HTML course , I'm planning on learning CSS and Javascript from your channel after finishing HTML, after Javascipt I will learn Rust programming language, can you make a course on Rust as well ? It would be really great
Love from Oman
lmao bro code when did you become gigachad
Olá, a nossa plataforma gostaria de o convidar a anunciar para nós e nós pagaremos pelo seu anúncio, por favor contacte-me se estiver interessado, obrigado"
Hey bro!
I'm from Brazil and I don't have money to learn here....
With you I learn English and to program.
Thank you from the heart.
God bless you
Somos dois irmão! 🇧🇷
where u bro in this time?
IT was a wonderful experience to go through this set of 90 videos for JS, learned a lot, I salute you code bro!
A nice way to learn some of the beginner stuff, and the way you coded it was really clean.
Wait this is beginner stuff?
@@mbg_legend3077yes it is
underrated channel, very fast and daily uploading of a very useful content. thank you so much this is absolutely helpful to me while I am currently learning js
Yeah and he's one of the few people that can explain in simple terms what code is doing. idk why others seem to stumble over their explanations
@@puppergump4117 so trueeee!!
Luckily I started in your java tutorial series when I discovered your channel, javascript has a lot of common format for the syntax. I'm also studying your DS&A tutorial series, and that one is heavily related to both of these two languages that I am learning as well.
Hopefully I will finish that DS&A too so that I can go over c# and c++ programming.
Thank so much, best javascript course EVER!!!! thankyou so much Bro, Gog Bless you
You have domenstrated game development briefly i cant thank you enough❤️
Keep up the good work. I really appreciate your content. This copywork and trying to understand it is the best way for me to learn as fast as possible.
I made my pong game more like the original in black and white and it looks nice. Thanks for the tutorial Bro Code.
Would be nice to get Bro video about Java Springboot tutorial...
Just now i knew that I can build a whole website with just a short html code and a huge js code. This content is perfect 👌 keep on it
I hope ur viewers came back man
I love ur vids ty for everything u've done
Much love bro ❤
You have 420 thousand subs rn. Congratulations! Keep up the good content Bro. You are one of the best tutors on TH-cam.
In such a nerdy industry its great to have a chad among us
Thanks a lot for this valuable Video
freaking amazing series!
i got it to the end of the course. thank you very much!
you literally upload the best programming content on youtube
Love your videos. Can you please make a playlist on React?
Can you please do some tutorials on c# advanced topics like control and connecting to database please? I am a biggest fan i have seen all your videos about swing and now am pro on swing thanks to you bro ✌️✌️
Can you make a tutorial php & laravel please
Javascript Looks like a Great Coding Language!
Gonna learn it after C++.
Thanks again for Uploading Quality Coding Videos
its not
Please make more cool games with Java too 🙏🙏
Bro Can u do tutorial on JavaScript ES2022 .
Hello bro! I love your channel and I learned a lot from you, and I want to ask you if you can make a PHP course.
This is the channel we all needed but don't deserve.
Hey Bro, I’m a big fan of your channel. I just graduated high school and I’m majoring in Computer Science next year. I want to spend the summer coding, but I don’t know where to begin.
I’m essentially starting from scratch after taking a course in Python from Udacity. My main interests are working with data and math (I’ve taken multivariable calculus). I’m asking you because I enjoy your detailed content, and I know you’ll have a lot of experience answering these types of questions. I’m looking to learn robust skills and make cool projects and generally avoid being bored. Hope you can help. Thanks.
Please make course on PyGame tutorial
loving this content, simple yet effective way to explain. keep it up
!
Hey bro is it possible you make a tutorial about programming phones with android studio after this JS course? (Thanks alot for coming back to youtube).
Thank you you are the best bro I hope you open a live stream to make allow us to talk with you
Please make a video on class time table management system software only using Java
Sir, can you make a tutorial on Nodejs ?
Hey man! I am a college student, and your tutorials have helped me immensely. Do you have a patreon, or a donation website for us to show our gratitude? I would like to pay you a cup of coffee (or a beer) lol. All this knowledge for free is just crazy! Thank you so much!
Ikr this dude is so good with his explaining
this channel is so underrated
Can you make a Lua course?
Hey dude just asking r u gonna do any c# games and stuff like the rock paper scissors and guess the number ones because they were really fun to follow and learn! Keep the amazing work up!
thanks, this is really helpfull for me, can you do same as this play list about react?
You are a legend !!!! and a big inspiration. You make coding super easy. Would love to know if you will be doing any content on WEB 3.0...A BIG THING!! Your great knowledge will really go a long way to help us understand all about solidity and building web3 dApps
u can write dapps in React & pure JS tho
same bro
Thanks dude for this amazing playlist , keep it up 🔥🔥
please can you make a video about reflexion thanks and listener in other class
Can you do ethical hacking/cyber security courses?
Could you make a tutorial series on Java Spring Boot? Pretty please with cherry on top?
heyy mate bro code is back!
Thank you bro Code. Make a React video please
Your voice and content is dam good ❤️
Can you make a django tutorial?! You are the best
You deserve so much more subs your videos is entertaining and educational at the same time keep doing the great job you are doing
Bro helps me!!!!!
How can I publish my HTML website on the internet?
Excellent work
Bro actually a legend.
Would you please
Give me a road map for learning programming the fastest and most *efficient way* ???
the top, when I installed soft soft (restart didn't help). I have a creative softblaster z softcard. I'm assuming it has sotNice tutorialng to do
bro please make tutorial c++ OOP
Do Lua programming language as your next tutorial series!
Well, I gotta watch this one now.
Btw, are there any chances of you making a Lua tutorial?
How to increase and decrease the speed of the ball ?
Hey Bro, please update the video as soon as possible, I am looking forward to it!!!🤩🤩🤩🤩
hi i have a suggtion for a video do you think you could make a video on how to make a extension for crome? (if you havint already)
Hey bro pls can you give us tut on php?
Hello, Please make a video on data structures and algorithms in python
@BroCodez bro could you please make a project on Sudoku Game In Web Development and in that project there will be different types of level and every new game there is a new game board where the numbers from 1 to 9 will be in random order in random section in every new game and there is a button whose name is solution and when you click on that button you can see the solution of that particular game and every new game the solution button will give the appropriate solution for that game.
Hi Bro, why doesn't VS code offer code completetion while you're coding in Javascript and when you press dot?
How to become a pro coder at leetcode??
I don't know if you have time, but I request you to make videos on a few Scripting Language(Like : Lua, Squirrel etc).
much ❤
9:50 idk why but it doesnt draw the paddle :( anyone can help me? i checked the code, everything checks out but it doesnt draw the paddle. only difference in my code is that i typed "black" instead of whatever colour he chose :(
console says "cannot rea properties on null" for gameBoard
can you please make course about Lua i wanna learn that to make games in love :(
var player1 = {x: 10, y: 200}
var player2 = {x: totalWidth-20, y:200}
var ball = {x: totalWidth/2-5,
y: totalHeight/2-5,
xSpeed: 3,
ySpeed: 3};
function update()
{
fill ("black")
rectangle(player1.x, player1.y, 10, 80, "white");
rectangle(player2.x, player2.y, 10, 80, "white");
rectangle(ball.x, ball.y, 10, 10, "white");
if (ball.y > totalHeight-10) {ball.ySpeed = -ball.ySpeed; }
if (ball.y < 0) {ball.ySpeed = -ball.ySpeed;}
if (ball.x > totalWidth-30 &&
ball.y > player2.y &&
ball.y < player2.y+80)
{
ball.xSpeed = -ball.xSpeed;
}
else if (ball.x > totalWidth-30)
{
ball.x = totalWidth/2-5;
}
if (ball.x < 30 &&
ball.y > player1.y &&
ball.y < player1.y+80)
{
ball.xSpeed = -ball.xSpeed
}
else if (ball.x < 20)
{
ball.x = totalWidth/2-5;
}
if (keyboard.w) {player1.y -=10;}
if (keyboard.s) {player1.y +=10;}
if (keyboard.up) {player2.y -=10;}
if (keyboard.down) {player2.y +=10;}
ball.x += ball.xSpeed;
ball.y += ball.ySpeed;
}
Hello Bro Code, can you make a video to talk about programming 2D games in python?
You are amazing
I watch your videos and they are helpful
Now I have a project but I have some problems
Can you help me with my project?
Hello dude. I just wanma ask if the contents you have in this 90-video playlist is the same with the other playlist containing 60 videos. I just found both of the playlist when I'm looking for your tutorial on javascript.
Pls bro can you make video how to get your first job jr position
Can you make haxe full course?
bro can you make tutorials on advanced java???
can u make a video about discrete math
What a legend, this is really cool
Bro pls make the typescript programming language tutorial, i need it
Could you make program to calculate E=MC2?
you are doing god's work
Hey bro! I want some advice.
From u I have learned java and learning javascript but I am one of those guys who suffer from imposter syndrome. so what should I do? if I have to do some example projects can u give me ideas?
BTW you make epic videos, keep it up, and best of luck :thumbsup: .
bro you are awesome
Wow after a long time bro how are you doing
embarrassed to say it, but 1st, I rap. I don't do computers and DAWs and all that cos with it. That said, 2, I first was introduced to
hey bro can you create a game like a mario?
Definitely! Send a text on WhatsApp to the number displayed above. Let's work!!
great bro. rust language video want
anyones ball get stuck on checkCollision function?
make a ruby course please
You must do Cobol. And Basic
Bro please do Node.js Course i am waiting since 2 years bro
Bro can ya make a vid for LUA pls?
Can you do rust please
Lua next please
Bro code in a few days:
Re making an os in javascript
Also next cpp video when :v
but how can you move paddle2???
Hey bro!
Your are the best 💖
Bro java game builds plees
BRO CAN YOU MAKE MORE VIDEOS IN JAVA ITSELF
hi bro.Do django full course pls
pov ur with a 60 percent keyboard