Page 737 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 737
if (input_5==False):
ser.write('1')
stage=1
ask=0
coin=0
time.sleep(.01)
elif ask==0:
if stage==1:
random_index=random.randrange(3)
screen.blit(text_stage_1,(900,450))
input_13=GPIO.input(13)
if(input_13==False):
count=1
time.sleep(.01)
input_19=GPIO.input(19)
if(input_19==False):
count=2
time.sleep(.01)
input_26=GPIO.input(26)
if(input_26==False):
count=3
time.sleep(.01)
#라즈베리파이로부터 a를 받으면 게임시작
if coin==0:
screen.blit(text_computer1,(700,450))
data=ser.readline()
if data=='a':
coin=1
if count==1:
if game_list[random_index]=="rock":
screen.blit(rock,(820,250))
elif game_list[random_index]=="scissors":
screen.blit(scissors,(820,250))
elif game_list[random_index]=="paper":
screen.blit(paper,(820,250))
screen.blit(rock,(180,250))
if game_list[random_index]=="rock":
screen.blit(text_draw,[200,570])
count=0
- 730 -