From ccf08724abcd718fa2a3d39ee14d7874f861fdb9 Mon Sep 17 00:00:00 2001 From: Brosef Date: Wed, 25 Jun 2025 08:00:32 +0100 Subject: [PATCH] Switched from importing randint to importing random --- game.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game.py b/game.py index 2cf19e4..2a9f80e 100644 --- a/game.py +++ b/game.py @@ -1,6 +1,6 @@ import logging import pygame -from random import randint +import random import gameUtils #Oh god here we go. I'm gonna screw up this entire thing @@ -68,7 +68,7 @@ class Game(gameUtils.Game): #I feel horrible writing this code this feels super unoptimised :c # Bro I'm gonna be honest, there's not much I'd change about that, you're good. # The only thing I can think if just moving `set_volume()` to after both if statements. - self.musicNumber = randint(1,2) + self.musicNumber = random.randint(1,2) if self.musicNumber == 1: pygame.mixer.music.load("./assets/surrounded.ogg") self.playMusic(-1) @@ -80,7 +80,7 @@ class Game(gameUtils.Game): def fire(self):#LETS GO GAMBLING - if randint(1,6) == 6: + if random.randint(1,6) == 6: self.playSound(self.gunShot) self.turnHandler.playing[0].punish(self.shockScale) print(f'{self.turnHandler.playing[0].name} is fucking dead.') @@ -112,7 +112,7 @@ class Game(gameUtils.Game): self.playSound(self.gunSpin) elif event.type == gameUtils.AnimFinish: if event.objectID == self.gun.objectID and event.animationID == 'spin': - self.timeout("FireDelay",randint(750,2000)/1000) + self.timeout("FireDelay",random.randint(750,2000)/1000) self.playSound(self.gunCyclinderStop) elif event.type == gameUtils.Timeout and event.timeoutID == 'FireDelay':