Click here to Skip to main content
15,889,096 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to speech russian text in C#? Pin
Ldta20-Dec-17 1:43
Ldta20-Dec-17 1:43 
GeneralRe: How to speech russian text in C#? Pin
Pete O'Hanlon20-Dec-17 2:43
mvePete O'Hanlon20-Dec-17 2:43 
QuestionDrag and drop dynamically a video from a media player to another container Pin
Hervend19-Dec-17 0:19
Hervend19-Dec-17 0:19 
AnswerRe: Drag and drop dynamically a video from a media player to another container Pin
Richard MacCutchan19-Dec-17 2:48
mveRichard MacCutchan19-Dec-17 2:48 
GeneralRe: Drag and drop dynamically a video from a media player to another container Pin
Hervend19-Dec-17 20:37
Hervend19-Dec-17 20:37 
Questionsave appointment on the shared exchange calendar Pin
maxim^18-Dec-17 23:22
maxim^18-Dec-17 23:22 
AnswerRe: save appointment on the shared exchange calendar Pin
OriginalGriff18-Dec-17 23:26
mveOriginalGriff18-Dec-17 23:26 
AnswerRe: save appointment on the shared exchange calendar Pin
Pete O'Hanlon19-Dec-17 4:03
mvePete O'Hanlon19-Dec-17 4:03 
Questionlambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Krellon18-Dec-17 23:02
Krellon18-Dec-17 23:02 
AnswerRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
OriginalGriff18-Dec-17 23:25
mveOriginalGriff18-Dec-17 23:25 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Krellon19-Dec-17 0:13
Krellon19-Dec-17 0:13 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Richard Deeming19-Dec-17 2:19
mveRichard Deeming19-Dec-17 2:19 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Krellon19-Dec-17 5:37
Krellon19-Dec-17 5:37 
SuggestionRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Richard Deeming19-Dec-17 2:17
mveRichard Deeming19-Dec-17 2:17 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
OriginalGriff19-Dec-17 2:26
mveOriginalGriff19-Dec-17 2:26 
QuestionHaving trouble working with balls on Pong game in Windows forms in C# Pin
Wagner18-Dec-17 4:29
Wagner18-Dec-17 4:29 
I'm new to programming and is currently working on Windows Forms where i'm developing a basic Pong game. I'm trying to follow a video which shows how to make a simple Pong game but although it's easy to just copy the code being written i'm not really understanding what exactly is happening since it's not explained.

I'm particulary having trouble understanding the code blocks below.

This block of code is supposed to represent points being increased by one for player 1 i think:

if (ball.Location.Y < 0)
            {
                pl1Score++;
                ball.Location = new Point(this.Width / 2, this.Height / 2);

            }

but what does
if (ball.Location.Y < 0)
mean? What does the if statement represent?

Aswell as:
if (ball.Location.X > player1.Location.X && ball.Location.X + ball.Width < player1.Location.X + player1.Width && ball.Location.Y + ball.Height > player1.Location.Y)
            {
                
                bvelY *= -1;
            }

bvelY is a variable representing speed of the ball btw.

And another one is
if (ball.Location.Y > this.Height)
            {
                pl2Score++;
                ball.Location = new Point(this.Width / 2, this.Height / 2);
            }

That increases points for player 2 i think. But i'm not understanding the
if (ball.Location.Y > this.Height)
statement

I haven't really found any tutorials or pages that explain these things, so that's why i'm asking here. Could someone give a good description of what these things mean? Would be appreciated.

Sorry if this may come off as a stupid question, i'm new here.
AnswerRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Kenneth Haugland18-Dec-17 4:34
mvaKenneth Haugland18-Dec-17 4:34 
GeneralRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Wagner18-Dec-17 4:53
Wagner18-Dec-17 4:53 
AnswerRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Ron Nicholson18-Dec-17 5:25
professionalRon Nicholson18-Dec-17 5:25 
GeneralRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Wagner18-Dec-17 6:46
Wagner18-Dec-17 6:46 
AnswerRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Gerry Schmitz18-Dec-17 6:35
mveGerry Schmitz18-Dec-17 6:35 
GeneralRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Wagner18-Dec-17 7:28
Wagner18-Dec-17 7:28 
GeneralRe: Having trouble working with balls on Pong game in Windows forms in C# Pin
Gerry Schmitz18-Dec-17 7:45
mveGerry Schmitz18-Dec-17 7:45 
QuestionConfigure container in Bootstrapper with Unity Pin
Kenneth Haugland17-Dec-17 3:17
mvaKenneth Haugland17-Dec-17 3:17 
AnswerRe: Configure container in Bootstrapper with Unity Pin
Chris Quinn17-Dec-17 21:36
Chris Quinn17-Dec-17 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.