Python Forum
[PyGame] Random.randint not working please help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Random.randint not working please help
#3
Hello Ive changed the line to the following but im still receiving an error on line 24:

21-#enemy
22-enemyImg=pygame.image.load("alien.png")
23-#enemy location on screen
24-enemyX = random.randint(0,800)
25-enemyY = random.randint(50,150)
26-enemyX_change = 0


ERROR:::::

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "c:/Users/Ozz.llc/Desktop/PYTHON/main.py", line 24, in <module>
enemyX = random.randint(0,800)
AttributeError: module 'random' has no attribute 'randint'

Ozz.llc@DESKTOP-H29PUP8 MINGW64 ~/Desktop/PYTHON
Reply


Messages In This Thread
Random.randint not working please help - by SupaNub - Dec-09-2019, 07:45 AM
RE: Random.randint not working please help - by SupaNub - Dec-09-2019, 02:18 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020