NabzPlays
NabzPlays
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
still need help
12 replies
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
12 replies
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
void moveBall() {
ballX =+ speedX;
ballY =+ speedY;
ballX = constrain(ballX, 0, width);
ballY = constrain(ballY, 0, height);
}

void bounceBall() {
if ((ballX - (ballWidth /2)) <= 0){
speedX = -speedX;
}
else if ((ballX + (ballWidth / 2)) >= width){
speedX = -speedX;
}
else if ((ballY - (ballWidth /2)) <= 0){
speedY = -speedY;
}
else if ((ballY + (ballWidth / 2)) >= height){
speedY = -speedY;
}
}
void draw() {
background(127);
// draw the ball
drawColourCircle(ballX, ballY, ballWidth, color(255, 0, 0));
// move the ball
moveBall();

if (checkCollide(ballX, ballY, ballWidth, holeX, holeY, holeWidth)) {
initializeHole();
initializeSpeed();
}

// bounce the ball ( if necessary)
bounceBall();
drawColourCircle(holeX, holeY, holeWidth, color(0));
}
void moveBall() {
ballX =+ speedX;
ballY =+ speedY;
ballX = constrain(ballX, 0, width);
ballY = constrain(ballY, 0, height);
}

void bounceBall() {
if ((ballX - (ballWidth /2)) <= 0){
speedX = -speedX;
}
else if ((ballX + (ballWidth / 2)) >= width){
speedX = -speedX;
}
else if ((ballY - (ballWidth /2)) <= 0){
speedY = -speedY;
}
else if ((ballY + (ballWidth / 2)) >= height){
speedY = -speedY;
}
}
void draw() {
background(127);
// draw the ball
drawColourCircle(ballX, ballY, ballWidth, color(255, 0, 0));
// move the ball
moveBall();

if (checkCollide(ballX, ballY, ballWidth, holeX, holeY, holeWidth)) {
initializeHole();
initializeSpeed();
}

// bounce the ball ( if necessary)
bounceBall();
drawColourCircle(holeX, holeY, holeWidth, color(0));
}
12 replies
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
I don't want to show all my code for obvious reason but heres some of it which i think my be causing the bug
12 replies
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
No description
12 replies
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
heres the work sheets:
12 replies
JCHJava Community | Help. Code. Learn.
Created by NabzPlays on 10/16/2024 in #java-help
Need help with fixing bug of ball not moving
currently this is the point i got to
12 replies
DIAdiscord.js - Imagine an app
Created by NabzPlays on 4/19/2024 in #djs-questions
How to make help command
@Qjuh
14 replies
DIAdiscord.js - Imagine an app
Created by NabzPlays on 4/19/2024 in #djs-questions
How to make help command
then create a new embed to append on?
14 replies
DIAdiscord.js - Imagine an app
Created by NabzPlays on 4/19/2024 in #djs-questions
How to make help command
so i will need to first check that 25 fields have been appended o the first embed
14 replies
DIAdiscord.js - Imagine an app
Created by NabzPlays on 4/19/2024 in #djs-questions
How to make help command
then i can only fit 25 fields on each embed
14 replies
DIAdiscord.js - Imagine an app
Created by NabzPlays on 4/19/2024 in #djs-questions
How to make help command
so if i have like 40 commands
14 replies
DIAdiscord.js - Imagine an app
Created by NabzPlays on 4/19/2024 in #djs-questions
How to make help command
isn't there a limit on how many fields you can have in an embed?
14 replies