Trick or Treat


A user on Ghost Town created a game that he claims no one can beat. Check out the game and find the flag hidden inside. Submit the flag as: flag{flag-goes-here}.

Download file
SHA1: 610430cb737a2a8478a9b9c53535e58010f14a91
Password: d34df4c3


The gameplay consisted of Grim Reapers dropping from the top of the screen and the player had to move their player to avoid colliding with the Reaper. The Reaper's movement speed increased after each successful dodge, making it increasingly difficult to dodge fast enough, thus ending the game.

After spending time reviewing the code we identified where the collision detection was performed int the get_intersect() function and simply replaced it with a pass:

def get_intersect(x1, x2, w1, w2, y1, y2, h1):
    if y1 < (y2 + h1):
        if x1 > x2 and x1 < (x2 + w2) or (x1 + w1) > x2 and (x1 + w1) < (x2 + w2):

We could then re-run the game and let it accumulate the "dodged" score. Once the score reaches 100 the flag was printed to the terminal:

$ python3
pygame 2.0.2 (SDL 2.0.16, Python 3.9.7)
Hello from the pygame community.



Leave a comment