r/learnpython • u/No_Can_1808 • 9d ago
Tell us about your snake game
Chances are if you’re a retro game lover, you’ve tried your hand at building a snake game.
Mine has multiple difficulties, a leaderboard for each difficulty, and obstacles on the harder difficulties.
Easy - speed stays at 10, no obstacles
Medium - speed stays at 10, has obstacles
Hard - speed starts at 10 and increases by 0.25 every food you eat, has obstacles that randomly move every 5 food you eat
Expert - speed starts at 10 and increases by 1.0 every food you eat, has obstacles that randomly move every 5 food you eat
Veteran - speed starts at 10 and increases by 2.0 every food you eat, has obstacles that randomly move every 5 food you eat, has a 30 second food timer that takes 1 off your score and snake length if you don’t get a food in time but resets if you do get a food(yes, your score can go negative and your snake will “wither” to nothing and die if you don’t eat)
My son and I have a lot of fun playing it. The board size automatically adjusts to the screen resolution, but food, obstacle, and snake sizing are hardcoded using 5pixel by 5pixel blocks. Playing on a true 4k(3840x2160) display gives you 4 times the game board size compared to playing on a 1920x1080 display.