class draw_maze(screen):NameError:name 'screen' is not defin
来源:学生作业帮 编辑:大师作文网作业帮 分类:英语作业 时间:2024/11/06 06:59:28
class draw_maze(screen):NameError:name 'screen' is not defined
'''
create on 2013\08\31
@author XGong
'''
import pygame
from pygame.locals import *
from random import randint,choice
global screen_size
screen_size=800
global r_color
r_color=(0,0,0)
class room(object):
def __init__(self,x,y):
self.x=x
self.y=y
self.wells=[True,True,True,True]
self.size=10
#self.visited=False
def visited(self):
return False
class draw_maze(screen):
room_list= [[0 for j in range(0,600)] for i in range(600)]
for i in range(0,600):
for j in range(0,600):
room_list[i]=room(i,j)
draw_room(screen,room_list[i][j],r_color)
class draw_room(screen,room,r_color):
n=0
for well in room.wells:
x=room.x
y=room.y
size=room.size
n=n+1
if well and n==1:
python.draw.line(screen,r_color,(x,y-size),(x,y))
if well and n==2:
python.draw.line(screen,r_color,(x,y),(x+size,y))
if well and n==3:
python.draw.line(screen,r_color,(x,y),(x,y+size))
if well and n==4:
python.draw.line(screen,r_color,(x-size,y),(x,y))
pygame.init()
screen=pygame.display.set_mode([screen_size,600])
pygame.display.set_caption("MAZE GAME")
screen.fill([255,255,0])
draw_maze(screen)
done=False
while done==False:
for event in pygame.event.get():
if event.type==QUIT:
done=True
pygame.display.flip()
pygame.quit()
'''
create on 2013\08\31
@author XGong
'''
import pygame
from pygame.locals import *
from random import randint,choice
global screen_size
screen_size=800
global r_color
r_color=(0,0,0)
class room(object):
def __init__(self,x,y):
self.x=x
self.y=y
self.wells=[True,True,True,True]
self.size=10
#self.visited=False
def visited(self):
return False
class draw_maze(screen):
room_list= [[0 for j in range(0,600)] for i in range(600)]
for i in range(0,600):
for j in range(0,600):
room_list[i]=room(i,j)
draw_room(screen,room_list[i][j],r_color)
class draw_room(screen,room,r_color):
n=0
for well in room.wells:
x=room.x
y=room.y
size=room.size
n=n+1
if well and n==1:
python.draw.line(screen,r_color,(x,y-size),(x,y))
if well and n==2:
python.draw.line(screen,r_color,(x,y),(x+size,y))
if well and n==3:
python.draw.line(screen,r_color,(x,y),(x,y+size))
if well and n==4:
python.draw.line(screen,r_color,(x-size,y),(x,y))
pygame.init()
screen=pygame.display.set_mode([screen_size,600])
pygame.display.set_caption("MAZE GAME")
screen.fill([255,255,0])
draw_maze(screen)
done=False
while done==False:
for event in pygame.event.get():
if event.type==QUIT:
done=True
pygame.display.flip()
pygame.quit()
__init__(self,screen)
Screen
name=raw_input("what is your name?") NameError:name 'raw_inp
Screen name has already been taken
Two couples screen name,two people in
screen printer does not support printing
screen 翻译
Screen City
screen是什么意思
screen printing
什么是screen
Make sure the screen is not too far from or too near your ey
make sure your screen is facing