From 1a34d7ca4af515490ed8016b486e99004e4fa6b6 Mon Sep 17 00:00:00 2001 From: Brosef Date: Mon, 23 Jun 2025 18:22:40 +0100 Subject: [PATCH] Added some documentation so whoever's working on this isn't entirely in the dark --- game.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/game.py b/game.py index bd61b4f..5e7640f 100644 --- a/game.py +++ b/game.py @@ -7,6 +7,11 @@ import random import json def normalDist(difficulty): + """ + This function generates a random number between 0-1 + that should be used to get a font with a difficulty + equal to or less than the number returned. + """ # Create a random number between 0-1 v = random.randint(-1000, 1000) / 1000 # Redistribute the number @@ -40,6 +45,9 @@ class Game(gameUtils.Game): self.fonts = {} + # I haven't finished this yet, you might want to create + # an object or something, I don't know. Keep in mind you + # have to load all of the font files for use later. with open(f'./fonts/fonts.json', 'r') as f: j = json.loads(f.read()) @@ -47,6 +55,11 @@ class Game(gameUtils.Game): # self.fonts.update() def createCaptcha(self): + """ + Use PIL (https://pillow.readthedocs.io/en/stable/handbook/tutorial.html) + to draw the fonts, add noise, random shapes, transforms etc. based on + self.gameDifficulty + """ pass def onEvent(self, event):