int drawPlane(int coor_y, bool isRight) { int size_x = 14, size_y=24; if (isRight) { draw_object(size_x, size_y, plane_right, 10, coor_y); usleep(1000); removePlane(size_x, size_y, 10, coor_y); coor_y+=1; } else { draw_object(size_x, size_y, plane_left,10,coor_y); usleep(1000); removePlane(size_x, size_y, 10, coor_y); coor_y-=1; } return coor_y; }
void Plane::update(float dt){ setPositionX(getPositionX()+speed); if (getPositionX()>580||getPositionX()<-30) { removePlane(this); } }