fork download
  1. #!/usr/bin/python
  2. # coding:utf-8
  3.  
  4. import pygame
  5. from pygame.locals import *
  6. import sys
  7.  
  8. import time
  9. import threading
  10.  
  11. #map Create
  12. lst=[0]*39
  13.  
  14. '''
  15. # mapName:Color_group:List_price:Construction_cost:Remarks
  16. #Color_group=0 White_Blank Color_group=1 Brown Color_group=2 Railway
  17. #Color_group=3 light blue Color_group=4 Bright purple
  18. #Color_group=5 Orange Color_group=6 Red Color_group=7 yellow Color_group=8 A public company Color_group=9 Green
  19. #Color_group=10 dark blue
  20. '''
  21.  
  22. #building&land information
  23. land0={ 'mapName':'GO', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Starting_point'}
  24. land1={ 'mapName':'Mediterranean_Street', 'Color_group':'1', 'List_price':'60', 'Construction_cost':'50', 'Remarks':'No_information'}
  25. land2={ 'mapName':'Joint_Fund', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pull_a_joint_fund_card'}
  26. land3={ 'mapName':'Baltic_Street', 'Color_group':'1', 'List_price':'60', 'Construction_cost':'50', 'Remarks':'No_information'}
  27. land4={ 'mapName':'income_tax', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pay_$200'}
  28. land5={ 'mapName':'Leading_train', 'Color_group':'2', 'List_price':'200', 'Construction_cost':'0', 'Remarks':'No_information'}
  29. land6={ 'mapName':'Oriental_street', 'Color_group':'3', 'List_price':'100', 'Construction_cost':'50', 'Remarks':'No_information'}
  30. land7={ 'mapName':'Accidentality', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pull_a_chance_card'}
  31. land8={ 'mapName':'Vermont_Avenue', 'Color_group':'3', 'List_price':'100', 'Construction_cost':'50', 'Remarks':'No_information'}
  32. land9 ={'mapName':'Connecticut_Street', 'Color_group':'3', 'List_price':'120', 'Construction_cost':'50', 'Remarks':'No_information'}
  33. land10={'mapName':'prison', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Nothing_happens_at_the_tour'}
  34. land11={'mapName':'St. Charles Place', 'Color_group':'4', 'List_price':'140', 'Construction_cost':'100', 'Remarks':'No_information'}
  35. land12={'mapName':'Power company', 'Color_group':'8', 'List_price':'150', 'Construction_cost':'0', 'Remarks':'No_information'}
  36. land13={'mapName':'State street', 'Color_group':'4', 'List_price':'140', 'Construction_cost':'100', 'Remarks':'No_information'}
  37. land14={'mapName':'Virginia Street', 'Color_group':'4', 'List_price':'160', 'Construction_cost':'100', 'Remarks':'No_information'}
  38. land15={'mapName':'Pennsylvania Railway', 'Color_group':'2', 'List_price':'200', 'Construction_cost':'0', 'Remarks':'No_information'}
  39. land16={'mapName':'St. James Place', 'Color_group':'5', 'List_price':'180', 'Construction_cost':'100', 'Remarks':'No_information'}
  40. land17={'mapName':'Joint_Fund', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pull_a_joint_fund_card'}
  41. land18={'mapName':'Tennessee Street', 'Color_group':'5', 'List_price':'180', 'Construction_cost':'100', 'Remarks':'No_information'}
  42. land19={'mapName':'New York Street', 'Color_group':'5', 'List_price':'200', 'Construction_cost':'100', 'Remarks':'No_information'}
  43. land20={'mapName':'Free parking', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'nothing happens'}
  44. land21={'mapName':'Kentucky Street', 'Color_group':'6', 'List_price':'220', 'Construction_cost':'150', 'Remarks':'No_information'}
  45. land22={'mapName':'Accidentality', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pull_a_chance_card'}
  46. land23={'mapName':'Indiana Street', 'Color_group':'6', 'List_price':'220', 'Construction_cost':'150', 'Remarks':'No_information'}
  47. land24={'mapName':'Illinois Avenue', 'Color_group':'6', 'List_price':'240', 'Construction_cost':'150', 'Remarks':'No_information'}
  48. land25={'mapName':'B & O Railway', 'Color_group':'2', 'List_price':'200', 'Construction_cost':'0', 'Remarks':'No_information'}
  49. land26={'mapName':'Atlantic Street', 'Color_group':'7', 'List_price':'260', 'Construction_cost':'150', 'Remarks':'No_information'}
  50. land27={'mapName':'Vent Nord street', 'Color_group':'7', 'List_price':'260', 'Construction_cost':'150', 'Remarks':'No_information'}
  51. land28={'mapName':'Water company', 'Color_group':'8', 'List_price':'150', 'Construction_cost':'0', 'Remarks':'No_information'}
  52. land29={'mapName':'Atlantic Street', 'Color_group':'7', 'List_price':'280', 'Construction_cost':'150', 'Remarks':'No_information'}
  53. land30={'mapName':'Go to jail', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Go to jail'}
  54. land31={'mapName':'Pacific Street', 'Color_group':'9', 'List_price':'300', 'Construction_cost':'200', 'Remarks':'No_information'}
  55. land32={'mapName':'North Carolina Street','Color_group':'9', 'List_price':'300', 'Construction_cost':'200', 'Remarks':'No_information'}
  56. land33={'mapName':'Joint_Fund', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pull_a_joint_fund_card'}
  57. land34={'mapName':'Pennsylvania Street', 'Color_group':'9', 'List_price':'320', 'Construction_cost':'200', 'Remarks':'No_information'}
  58. land35={'mapName':'Shortline railway', 'Color_group':'2', 'List_price':'200', 'Construction_cost':'0', 'Remarks':'No_information'}
  59. land36={'mapName':'Accidentality', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'Pull_a_chance_card'}
  60. land37={'mapName':'Park Place', 'Color_group':'10','List_price':'350', 'Construction_cost':'200', 'Remarks':'No_information'}
  61. land38={'mapName':'Excise Tax', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'I pay $ 100'}
  62. land39={'mapName':'Board walk', 'Color_group':'10','List_price':'400', 'Construction_cost':'200', 'Remarks':'No_information'}
  63.  
  64. # User information
  65. user_list0=[1500,'def','hij']
  66. #Movement value,Ownership,Asset management
  67.  
  68.  
  69. '''
  70. #Search keywords
  71. #for k in building0:print k
  72. #land={'mapName':'', 'Color_group':'0', 'List_price':'0', 'Construction_cost':'0', 'Remarks':'No_information'}
  73.  
  74. # User information
  75. user_list0=['abc','def','hij']
  76. print user_list0[0]
  77.  
  78. '''
  79.  
  80.  
  81.  
  82.  
  83. def main():
  84. (w,h) = (860,600) # 画面サイズ
  85. pygame.init() # pygame初期化
  86. pygame.display.set_mode((w, h), 0, 32) # 画面設定
  87. screen = pygame.display.get_surface()
  88. bg = pygame.image.load("monopolyBoard.png").convert_alpha() # 背景画像の取得
  89. rect_bg = bg.get_rect()
  90.  
  91. # reimu
  92. player = pygame.image.load("tohodots_byznp/01_00_reimu.png").convert_alpha()
  93. player2 = pygame.image.load("tohodots_byznp/01_01_reimu.png").convert_alpha()
  94. player3 = pygame.image.load("tohodots_byznp/reimu_works.jpg").convert_alpha()
  95.  
  96. # marisa
  97. player4 = pygame.image.load("tohodots_byznp/02_00_marisa.png").convert_alpha()
  98. player5 = pygame.image.load("tohodots_byznp/02_01_marisa.png").convert_alpha()
  99. player6 = pygame.image.load("tohodots_byznp/icon_marisa01-2.jpg").convert_alpha()
  100.  
  101. # remiria
  102. player7 = pygame.image.load("tohodots_byznp/03_00_remiria.png").convert_alpha()
  103. player8 = pygame.image.load("tohodots_byznp/03_01_remiria.png").convert_alpha()
  104. player9 = pygame.image.load("tohodots_byznp/remi.png").convert_alpha()
  105.  
  106. # sakuya
  107. player11= pygame.image.load("tohodots_byznp/04_00_sakuya.png").convert_alpha()
  108. player12= pygame.image.load("tohodots_byznp/04_01_sakuya.png").convert_alpha()
  109. player13= pygame.image.load("tohodots_byznp/saku.png").convert_alpha()
  110.  
  111. rect_player = player.get_rect()
  112. # rect_player.center = (550,550)
  113.  
  114.  
  115. aiueo=0
  116.  
  117. xxx=550
  118. yyy=550
  119.  
  120.  
  121. use01=2500
  122. use02=2500
  123. use03=2500
  124. use04=2500
  125.  
  126.  
  127. font = pygame.font.Font(None,14)
  128.  
  129.  
  130.  
  131.  
  132. while (1):
  133. pygame.display.update() # 画面更新
  134. pygame.time.wait(30) # 更新時間間隔
  135. screen.fill((0, 20, 0, 0)) # 画面の背景色
  136. screen.blit(bg, rect_bg) # 背景画像の描画
  137. #screen.blit(player, rect_player) # プレイヤー画像の描画
  138.  
  139.  
  140. screen.blit(player3,(600,0)) # アイコン画像の描画
  141. screen.blit(player6,(600,150))
  142. screen.blit(player9,(600,300))
  143. screen.blit(player13,(600,450))
  144.  
  145.  
  146. text = font.render("Possession money $2500",True,(255,255,255)) # 描画する文字列の設定
  147. screen.blit(text, [700,5])# 文字列の表示位置
  148.  
  149. text2 = font.render("Possession money $2500",True,(255,255,255)) # 描画する文字列の設定
  150. screen.blit(text2, [700,155])# 文字列の表示位置
  151.  
  152. text3 = font.render("Possession money $2500",True,(255,255,255)) # 描画する文字列の設定
  153. screen.blit(text3, [700,305])# 文字列の表示位置
  154.  
  155. text4 = font.render("Possession money $2500",True,(255,255,255)) # 描画する文字列の設定
  156. screen.blit(text4, [700,455])# 文字列の表示位置
  157.  
  158. #pygame.draw.rect(screen,(0,80,0),Rect(10,10,80,50),5) # 四角形を描画(塗りつぶしなし)
  159. pygame.draw.rect(screen,(165,75,150),Rect(700,17,15,20)) # 四角形を描画(塗りつぶし)
  160.  
  161.  
  162.  
  163. if aiueo==0:
  164. screen.blit(player,(xxx,yyy)) # プレイヤー画像の描画
  165. time.sleep(0.5)
  166. aiueo=aiueo+1
  167. elif aiueo==1:
  168. screen.blit(player2,(xxx,yyy)) # プレイヤー2画像の描画
  169. time.sleep(0.5)
  170. aiueo=0
  171. else :aiueo=0
  172.  
  173. screen.blit(player5,(20,550)) # プレイヤー画像の描画
  174. screen.blit(player8,(180,550)) # プレイヤー画像の描画
  175. screen.blit(player12,(0,550)) # プレイヤー画像の描画
  176.  
  177.  
  178.  
  179.  
  180. # 終了用のイベント処理
  181. for event in pygame.event.get():
  182. if event.type == QUIT: # 閉じるボタンが押されたとき
  183. pygame.quit()
  184. sys.exit()
  185. if event.type == KEYDOWN: # キーを押したとき
  186. if event.key == K_ESCAPE: # Escキーが押されたとき
  187. pygame.quit()
  188. sys.exit()
  189.  
  190. if __name__ == "__main__":
  191. main()
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
Runtime error #stdin #stdout #stderr 0s 23352KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 4, in <module>
ImportError: No module named pygame