【发布时间】:2020-07-25 15:45:06
【问题描述】:
import #pygame
from PYGAME.locals import *
from RECT import *
pygame.init()
#Make Screen
screen = pygame.display.set_mode((640,240))
#Defining the colors
BLACK = (0,0,0)
GRAY = (127,127,127)
WHITE = (255,255,255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
CYAN = (0, 255, 255)
MAGENTA = (255, 0, 255)
#Defining a function
def draw_point(text,pos):
img = font.render(text,True,BLACK)
pygame.draw.circle(screen,RED,pos,3)
screen.blit(img,pos)
我无法在第三行导入RECT 类。这是我第一次在网上发布疑问,感谢您的帮助。因此,我无法定义draw_point 函数。
【问题讨论】:
-
import #pygame->import pygame。from RECT import *->from pygame import Rect
标签: python python-3.x pygame pygame-surface