Help on Collision Detection Please
My collision detection won't work, why?bt1 = pygame.Rect(0, 0, 5, 5)
bt2 = pygame.Rect(0, 0, 5, 5)
bt3 = pygame.Rect(0, 0, 5, 5)
you_box = pygame.Rect(0, 0, 25, 44)
btm1 = Rect.move(bt1, bx, by)
btm2 = Rect.move(bt2, bx2, by2)
btm3 = Rect.move(bt3, bx3, by3)
you_boxm = pygame.Rect.move(you_box, x,y)
collide = Rect.collidelistall(you_box, bt1)
It won't work, why?!
(log in to comment)
Comments
bt1 = pygame.Rect(0, 0, 5, 5) bt2 = pygame.Rect(0, 0, 5, 5) bt3 = pygame.Rect(0, 0, 5, 5) you_box = pygame.Rect(0, 0, 25, 44) list = (bt1, bt2, bt3) you_box.collidelistall(list)This will work
eugman on 2007/04/03 10:38:
You probably need to use move_ip . If you don't move in place then you are just saving to btm1 what you would get if you moved. Just a random guess.