Saw this post and decided to give it a try...

Hi! I'm having a lot of fun with this Theme Slaughter Round!

I saw this post with a cool (and crazy) theme and decided to give it a try... Screenshot_174.png

So I used Python + Pygame, no game engines, no external files or assets and in the end it was 4 Lines of Code. And something important about it: The fact that I used python instead of C, C++ and others made it harder: since python don't use braces to define scopes but the code indentation, everything you put after the if, for loop and so on, as long as they're in the same line, it will technically belong to it.

Source Code

You just need to run this in any way you want to. But make sure you have pygame installed. py import pygame, random, time; pygame.init(); d,c = pygame.display.set_mode([840, 480]),pygame.time.Clock();pygame.display.set_caption("4 LOC Game!");score,p,a,f=0,pygame.rect.Rect(10,200,40,40), [], pygame.font.SysFont("Arial", 40);f.set_bold(True) while [obj for obj in pygame.event.get() if obj.type==pygame.QUIT]==[] and [o for o in a if p.colliderect(o)]==[]: score+=1;p.y=min(440,max(0, p.y));c.tick(60);random.seed(time.time());k=pygame.key.get_pressed();p.y+=(k[pygame.K_s]-k[pygame.K_w])*5; a=random.choice([a]*20+[a+[pygame.rect.Rect(840, random.randint(0, 440), 40, 40)]]) random.seed(0);a=[o.move(-2*(random.random()+1),0) for o in a]; d.fill([25]*3);[pygame.draw.rect(d, [200]*3, o) for o in a+[p]];d.blit(f.render("Score: "+str(score), True, [255]*3),[10,10]);pygame.display.update()

Showcase

I made a small gif showcasing the game: the 5 loc challenge showcase 2.gif

Want to know how I did it?

Gonna make a video explaining the challenges I face (believe it or not I had a bunch of them) and post on my youtube channel soon:

Subscribe to my YouTube Channel to Watch!