Search code examples
pythonpython-3.xpygamecollision-detectiontile

Display a sprite with no image - PyGame


I am working on a game project meant for learning and I was thinking if I create a sprite without a set image. I need this because I have an ideea to keep the value of the rect tiles that need collision in a sprite group. Is it possible?


Solution

  • Create a list of sprites excluding the invisible sprite(s):

    all_sprites_list.draw(screen)
    

    Then for collision just make a barrier list and put your invisible sprites that need collision in it.