1

I'm making physics mini game with renpy. I need a collision detection between rotating object (stick/paddle) and a falling object (ball) so I'm using masking for it, here's the code I used:

pic_alpha = renpy.load_surface(stick).convert_alpha()
pic_mask = pygame.mask.from_surface(pic_alpha)

but this doesn't work, it says :

AttributeError: 'module' object has no attribute 'mask'

in python it should be codes below and it works well:

obstacle = pygame.image.load("stick.png").convert_alpha()
obstacle_mask = pygame.mask.from_surface(obstacle)

So basically the game is about keeping a ball on a moving paddle from falling for a certain time, user controls the paddle's rotation with mouse movement (imagine seesaw) and the ball is sliding on top of it, you need to keep the balance to hinder the ball from falling.

Please help. Thank you.

0 Answers0