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.
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 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.
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 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!
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).
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
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: .
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.
@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.
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!!
You have 420 thousand subs rn. Congratulations! Keep up the good content Bro. You are one of the best tutors on UA-cam.
Thank so much, best javascript course EVER!!!! thankyou so much Bro, Gog Bless you
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.
I hope ur viewers came back man
I love ur vids ty for everything u've done
Much love bro ❤
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.
Javascript Looks like a Great Coding Language!
Gonna learn it after C++.
Thanks again for Uploading Quality Coding Videos
its not
freaking amazing series!
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
you literally upload the best programming content on youtube
This is the channel we all needed but don't deserve.
I made my pong game more like the original in black and white and it looks nice. Thanks for the tutorial Bro Code.
You deserve so much more subs your videos is entertaining and educational at the same time keep doing the great job you are doing
loving this content, simple yet effective way to explain. keep it up
!
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
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.
Would be nice to get Bro video about Java Springboot tutorial...
Please make more cool games with Java too 🙏🙏
this channel is so underrated
Love your videos. Can you please make a playlist on React?
i got it to the end of the course. thank you very much!
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 ✌️✌️
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.
In such a nerdy industry its great to have a chad among us
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!
Your voice and content is dam good ❤️
Thanks dude for this amazing playlist , keep it up 🔥🔥
Thanks a lot for this valuable Video
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).
Can you make a tutorial php & laravel please
Please make a video on class time table management system software only using Java
Please make course on PyGame tutorial
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
Well, I gotta watch this one now.
Btw, are there any chances of you making a Lua tutorial?
Bro Can u do tutorial on JavaScript ES2022 .
Sir, can you make a tutorial on Nodejs ?
Bro actually a legend.
Thank you you are the best bro I hope you open a live stream to make allow us to talk with you
heyy mate bro code is back!
Can you make a Lua course?
Can you make a django tutorial?! You are the best
thanks, this is really helpfull for me, can you do same as this play list about react?
Thank you bro Code. Make a React video please
Do Lua programming language as your next tutorial series!
Excellent work
Could you make a tutorial series on Java Spring Boot? Pretty please with cherry on top?
please can you make a video about reflexion thanks and listener in other class
What a legend, this is really cool
Hey bro!
Your are the best 💖
Wow after a long time bro how are you doing
Can you do ethical hacking/cyber security courses?
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, Please make a video on data structures and algorithms in python
bro can you make tutorials on advanced java???
you are doing god's work
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?
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! 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: .
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.
Hi Bro, why doesn't VS code offer code completetion while you're coding in Javascript and when you press dot?
Would you please
Give me a road map for learning programming the fastest and most *efficient way* ???
bro please make tutorial c++ OOP
Bro helps me!!!!!
How can I publish my HTML website on the internet?
Hello Bro Code, can you make a video to talk about programming 2D games in python?
can u make a video about discrete math
bro you are awesome
Can you make haxe full course?
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 ❤
great bro. rust language video want
Hey Bro, please update the video as soon as possible, I am looking forward to it!!!🤩🤩🤩🤩
How to increase and decrease the speed of the ball ?
Can you do rust please
How to become a pro coder at leetcode??
Bro, you should do a Kotlin tutorial!!!!
can you please make course about Lua i wanna learn that to make games in love :(
Hey bro pls can you give us tut on php?
Could you make program to calculate E=MC2?
Bro pls make the typescript programming language tutorial, i need it
Pls bro can you make video how to get your first job jr position
Can you teach rust?
make a ruby course please
Bro can ya make a vid for LUA pls?
@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.
hey bro can you create a game like a mario?
Definitely! Send a text on WhatsApp to the number displayed above. Let's work!!
Hey dude, your videos are FANTASTIC! Can you make a Hotel Reservation System with Java Swing and Database?
BRO CAN YOU MAKE MORE VIDEOS IN JAVA ITSELF
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
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
hi bro.Do django full course pls
Lua next please
You must do Cobol. And Basic
pov ur with a 60 percent keyboard
Bro java game builds plees
Bro code in a few days:
Re making an os in javascript
Also next cpp video when :v
but how can you move paddle2???