我是pygame的新手,我有這個錯誤請幫助我。TypeError:'模塊'對象在pygame中無法調用
backgrounf_image_filename = 'ubisoft.jpg'
mouse_image_filename = 'cursor.png'
import pygame
from pygame.locals import *
from sys import exit
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
pygame.display.set_caption("Hello World!")
background = pygame.image.load(backgrounf_image_filename).convert()
mouse_cursor = pygame.image(mouse_image_filename).convert_alpha()
和我有一個錯誤:
Traceback (most recent call last):
File "C:/Users/ziyaa/PycharmProjects/pygame/helloworld.py", line 13, in <module>
mouse_cursor = pygame.image(mouse_image_filename).convert_alpha()
TypeError: 'module' object is not callable
Process finished with exit code 1
的第一篇文章,其中包括完整的堆棧跟蹤:那好,值得一個upvote,一個答案:) –
作爲一個人指出,你的縮進最後有點關閉。您可能會遇到問題(但這與問題無關,我將編輯該問題) –