我正在C#上編程Visual Studio 2016,並且正在製作遊戲。我需要重複一個pictureBox。它應該從屏幕的右側開始,然後移動到屏幕的左側。如何在屏幕上重複圖片框來模擬動畫?
我該怎麼做?目前,我有這樣的代碼:
while (pictureBox4.Location.X == -10 && pictureBox4.Location.Y == -2)
{
pictureBox4.Location = new Point(pictureBox4.Location.X - x, pictureBox4.Location.Y - y);
}
X & y是隨機變量。
我很驚訝,當看到你在Visual Studio 2016編程)您是指2015年或2017? –
這是VS 2017,對不起 –
'while(pictureBox4.Location.X == -10' should not that'> ='?? if'while'while while'。慷慨和add和'else'子句!當然,沒有告訴我們代碼從哪裏來的都是猜測......! – TaW