I have a board game and its size is 500 (w) x 420 (h)
and I also have a ball, whose initial position is w/2 and h
relative to x and y axis which is at the middle bottom of the board. However, when I run the program, the ball is always placing below out of the window. That would make no sense at all to me since I only set the y position of the ball equal to height. Is it a glitch or am I doing anything wrong in here ?
Here is my snipet code:
private double ballrealcoordinatex; //Ball's x coordinate measured in real numbers
private double ballrealcoordinatey; //Ball's y coordinate measured in real numbers
private int ballintx; //The integer x-coordinate of the ball
private int ballinty; //The integer y-coordinate of the ball
public Form1()
{
InitializeComponent();
//Set start position of the ball
ballrealcoordinatex = (double)(Width / 2 - ballradius);
ballrealcoordinatey = Height; // (double)(Height / 2 - ballradius);
ballintx = (int)System.Math.Round(ballrealcoordinatex);
ballinty = (int)System.Math.Round(ballrealcoordinatey);
}