private void Eat_Tick(object sender, EventArgs e) { if (listthucan[0].Location == SnakeHeads[0].Location) { panel1.Controls.Remove(listthucan[0]); listthucan.RemoveAt(0); food = new FoodforAdvanced(); food.TaoThucAn(panel1, listthucan); score += 10; label2.Text = score.ToString(); BodyMove.Start(); } }
void startgame() { R = true; L = false; D = false; U = false; score = 0; load(); obstacle = new Obstacle(); obstacle.taovatcan(panel1, tuong); HeadMove.Start(); Eat.Start(); BodyMove.Start(); food = new FoodforAdvanced(); food.TaoThucAn(panel1, listthucan); Panel.Start(); }