2D collisions in pygame

0

I already have the collision by means of a library function pygame . The function returns True each time a collision is generated.

My problem is this:

I want to make that when a collision is True I can not transfer that object (rectangle) by another rectangle similar to a wall, but I can not find the correct algorithm.

The code looks like this:

if rectangulo.colliderect(recatangulo_2):
    #aqui debe ir el algoritmo que impida 
    #que los objetos se transpasen (como un muro )
    
asked by Erick Toledo 14.09.2018 в 04:37
source

0 answers