marine2oorah4u
marine2oorah4u
CC#
Created by marine2oorah4u on 7/20/2024 in #help
how do i make a loop or array to choose between different color[]? (csharp)
Which idk how I would do that I’m sure I can figure it out once I add or get the above code added successfully
11 replies
CC#
Created by marine2oorah4u on 7/20/2024 in #help
how do i make a loop or array to choose between different color[]? (csharp)
The thing that I’m worried about or know I’ll have to figure out too is Which I’m sure I’ll have to do it in the game state or draw? Is that I’m sure I’ll have to link said skin chopper in a picker scroll system
11 replies
CC#
Created by marine2oorah4u on 7/20/2024 in #help
how do i make a loop or array to choose between different color[]? (csharp)
Ok I’ll try after work
11 replies
CC#
Created by marine2oorah4u on 7/20/2024 in #help
how do i make a loop or array to choose between different color[]? (csharp)
how could it be done though?
11 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
ok
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
which im appreciative of
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
tbh you replied to my post almost instantly, so i was quite supprised i got someone to respond or had any interest so suddenly lol
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
im just saying dont worry about diving deep into this
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
i know
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
or here
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
x,y is point 1
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
but again dont worry about doing it right now that's just what id overal would love help on/with
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
or just overall an easier understanding
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
but at one point, i want to be able to take what my friend says here in this (his post) and to take this code
if (ballRect.X <= player1Rect.X + player1Rect.Width && // point 1 X <= point 2 X
ballRect.Y <= player1Rect.Y + player1Rect.Height && // point 1 Y <= point 3 Y
ballRect.Y + ballRect.Height >= player1Rect.Y) // point 3 Y <= point 2 Y
{
ballVelocityX = -ballVelocityX;
}
if (ballRect.X <= player1Rect.X + player1Rect.Width && // point 1 X <= point 2 X
ballRect.Y <= player1Rect.Y + player1Rect.Height && // point 1 Y <= point 3 Y
ballRect.Y + ballRect.Height >= player1Rect.Y) // point 3 Y <= point 2 Y
{
ballVelocityX = -ballVelocityX;
}
and to break each line/condition down or to understand each outcome/scenario better
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
not rn
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
"Examine this diagram. 4 balls, numbered 1 to 4 (in blue) and the black paddle.
if (ballRect.X <= player1Rect.X + player1Rect.Width && // point 1 X <= point 2 X
ballRect.Y <= player1Rect.Y + player1Rect.Height && // point 1 Y <= point 3 Y
ballRect.Y + ballRect.Height >= player1Rect.Y) // point 3 Y <= point 2 Y
{
ballVelocityX = -ballVelocityX;
}
if (ballRect.X <= player1Rect.X + player1Rect.Width && // point 1 X <= point 2 X
ballRect.Y <= player1Rect.Y + player1Rect.Height && // point 1 Y <= point 3 Y
ballRect.Y + ballRect.Height >= player1Rect.Y) // point 3 Y <= point 2 Y
{
ballVelocityX = -ballVelocityX;
}
The first line, as the comment says, is testing if the X of point 1/3 of the ball (the left edge) is <= (less than or equal to) the X of point 2/4 of the paddle (the right edge). Because the ball is moving to the left, we are testing if the movement of the ball for this frame (it's velocity) has caused it to move from the right hand side of the paddle right edge to either directly on its right edge or to the left of it. If this is true, then the ball has potentially collided with the paddle on this frame. So now we have to also test the Y positions to check if it has actually hit the paddle, or if it has just moved past it like ball 4 will do. So the second line of that if statement is testing if the Y of point 1 of the ball is <= (less than or equal to) the Y of point 4 of the paddle. Balls 1, 2 and 3 all meet this condition. Their point 1 Y is <= the paddles point 4 Y. Because ball 4 fails that test, we know it cannot hit the paddle, so it doesn't even bother with the next test. So if Y of point 1 of the ball is <= point 4 of the paddle, we know it is still possible the ball could have collided with the paddle, so we now do line 3 of that if statement. Line 3 is testing if the Y of point 3 of the ball is >= (greater than or equal to) the Y of point 2 of the paddle. If the Y is < then we know the ball is above the paddle and has not collided. You will see that the Y of point 3 for all the balls is greater than the Y of point 2 of the paddle, so they will all hit the paddle except ball 4 which we stopped testing for in line 2 (it failed so the if statement aborts and the velocity is not negated). And that is why line 2 and 3 of that if statement are exactly the same for the other paddle. The Y tests don't change, because we are only testing the left/right (horizontal) edges. If we were to also test the top and bottom edges, which is necessary for a robust collision, then we would also need to change the Y tests depending which edge we are testing."
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
learning collission, or 1sec
56 replies
CC#
Created by marine2oorah4u on 5/20/2023 in #help
❔ looking to find smneto help me understand offsets via Rects/collission (also help w c# in general)
no offense
56 replies