add global class,have 2 variable and 1 check collision per pixcel