From aa1733526acad10b8bb3f9d8ebbab1c3258ee606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Fri, 6 May 2022 23:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=AF=B9random=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index 1038edb..cc60678 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -1,4 +1,4 @@ -import random +from random import randint import pygame as pg import os from .. import tool @@ -973,7 +973,7 @@ class WallNutBowling(Plant): self.animate_interval = 200 self.move_timer = 0 self.move_interval = 70 - self.vel_x = random.randint(12, 15) + self.vel_x = randint(12, 15) self.vel_y = 0 self.disable_hit_y = -1 @@ -1022,7 +1022,7 @@ class WallNutBowling(Plant): elif self.map_y == (c.GRID_Y_LEN - 1): direc = -1 else: - if random.randint(0, 1) == 0: + if randint(0, 1) == 0: direc = 1 else: direc = -1 @@ -1057,7 +1057,7 @@ class RedWallNutBowling(Plant): self.animate_interval = 200 self.move_timer = 0 self.move_interval = 70 - self.vel_x = random.randint(12, 15) + self.vel_x = randint(12, 15) def loadImages(self, name, scale): self.idle_frames = []