I have a function that detects tilemap tiles and does the correct thing based on which tile it collided with however I have a big block of if statements just asking what the tile is then responding accordingly and It seems very inefficient. However, I was not able to find a way that doesn't include tons of if statements EX Code: if tile_id == 1: do this if tile_id == 2: do something else if tile_id == 3: do something else

maybe it suits you better with mach, it's better than using many if

TheDiavolo meant using a match statement, like this:

match tile_id:
    1:
        do this
    2:
        do something else
    3:
        do something else
    _:
        default case (run if none of the above cases are matched)

Generally there's nothing wrong with if statements. But the terseness you are seeking is exactly what match statements are for.

a year later