我想在表格中插入更多的球.但是,为了让它反弹,我必须为不同的球反复编码相同的算法.我是否知道如果不一遍又一遍地写它,我有什么办法可以做到的?我的代码如下.
int bBA1; //The x axis from the upper left corner
int bBA2; //The y axis from the upper left corner
int spdBBA1; //The change of x
int spdBBA2; //The change of y
public StartGame()
{
InitializeComponent();
}
private void StartGame_Load(object sender, EventArgs e)
{
//Loads the ball on the screen at bottom of the window
bBA1 = this.ClientSize.Width / 5; //The x axis the ball is loaded at
bBA2 = this.ClientSize.Height - 10; //The y axis the ball is …Run Code Online (Sandbox Code Playgroud)