資源簡介
Python項目案例開發從入門到實戰源代碼第11章 推箱子游戲代碼.rar
代碼片段和文件信息
from?tkinter?import?*
from?tkinter.messagebox?import?*
import??copy
root?=?Tk()
root.title(“?推箱子--夏敏捷“)
imgs=?[PhotoImage(file=‘bmp\\Wall.gif‘)
???????PhotoImage(file=‘bmp\\Worker.gif‘)
???????PhotoImage(file=‘bmp\\Box.gif‘)
???????PhotoImage(file=‘bmp\\Passageway.gif‘)
???????PhotoImage(file=‘bmp\\Destination.gif‘)
???????PhotoImage(file=‘bmp\\WorkerInDest.gif‘)
???????PhotoImage(file=‘bmp\\RedBox.gif‘)?]
#0代表墻,1代表人,2代表箱子,3代表路,4代表目的地
#5代表人在目的地,6代表放到目的地的箱子
Wall?=?0
Worker?=?1?
Box?=?2
Passageway?=?3
Destination?=?4
WorkerInDest?=?5
RedBox?=?6
#原始地圖
myArray1?=?[[0314333]
???????????[0332330]??
???????????[0030330]
???????????[3323000]
???????????[3433300]
???????????[0033330]
???????????[0000000]]
#繪制整個游戲區域
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????483??2001-06-05?21:51??第11章??推箱子游戲代碼\bmp\box.gif
?????文件????????338??2001-06-05?21:50??第11章??推箱子游戲代碼\bmp\Destination.gif
?????文件???????1152??2016-03-13?09:06??第11章??推箱子游戲代碼\bmp\passageway.gif
?????文件????????426??2001-06-05?21:50??第11章??推箱子游戲代碼\bmp\redbox.gif
?????文件???????1029??2001-06-05?17:26??第11章??推箱子游戲代碼\bmp\wall.gif
?????文件???????1806??2016-03-13?09:16??第11章??推箱子游戲代碼\bmp\worker.gif
?????文件????????291??2001-06-05?21:52??第11章??推箱子游戲代碼\bmp\WorkerInDest.gif
?????文件???????5630??2018-08-02?09:38??第11章??推箱子游戲代碼\推箱子?-??V2.1.py
?????目錄??????????0??2018-11-07?19:54??第11章??推箱子游戲代碼\bmp
?????目錄??????????0??2018-11-07?19:54??第11章??推箱子游戲代碼
-----------?---------??----------?-----??----
????????????????11155????????????????????10
評論
共有 條評論