void checkBirdImpact(Colums colTemp) { //Lấy chim ra birdX = bird.getBird().Location.X; birdY = bird.getBird().Location.Y; //Cột dưới colBotomX = colTemp.getColBotom().Location.X; colBotomY = colTemp.getColBotom().Location.Y; if ( (colBotomX <= birdX + 33 && birdY + 28 >= colBotomY) && birdX <= colBotomX + 43 ) { timerColum.Enabled = false; timerOfBird.Enabled = false; } //Cột trên colTopX = colTemp.getColTop().Location.X; colTopY = colTemp.getColTop().Location.Y; if ( (colTopX <= birdX + 33 && birdY <= colTopY + colTemp.getColTop().Height) && birdX <= colTopX + 43 ) { timerColum.Enabled = false; timerOfBird.Enabled = false; } }
void circleLifeColums(Colums before, Colums current) { pointBrefore = before.getColBotom().Location.X + before.getColBotom().Width + 100; if (current.getColBotom().Location.X + 43 <= 0) { temp = current.getColBotom(); temp.Location = new Point(pointBrefore, rd.Next(110, 234)); current.setColBotom(temp); } }
void columMove(Colums col) { col.getColBotom().Left -= 1; col.getColTop().Left -= 1; }
void defineColums() { col1 = defineColum(300); col2 = defineColum(col1.getColBotom().Location.X + col1.getColBotom().Width + 100); col3 = defineColum(col2.getColBotom().Location.X + col2.getColBotom().Width + 100); }