Original Post
well I am still working on breakout using c#.I have done alot of research on game loops and have found the following .
thanks for all the help
}
private void Form1_Load(object sender, EventArgs e)
{
Application.Idle += new EventHandler(Application_Idle);
}
private void Application_Idle(Object sender, EventArgs e)
{
Graphics g=this.CreateGraphics();
Image ball_image = Image.FromFile(@"c:\Users\phil\Desktop\ball.bmp");
g.DrawImage(ball_image, x + vx, y + vy);
x += vx;
y += vy;
if (y >= bottom_wall || y<=top_wall)
{
vy = -vy;
}
if (x >= right_wall || x <= left_wall)
{
vx = -vx;
}
if ((x >= paddle_left+paddle_x && x <= paddle_right+paddle_x) && (y >= paddle_top ))
{
vx = -vx;
vy = -vy;
}
if ((x <= brick_left && x >= brick_right + paddle_x) && (y <= brick_bottom))
{
vx = -vx;
vy = -vy;
}
}
}
thanks for all the help
}