MINECRAFT編程:使用Python語言玩轉我的世界

MINECRAFT編程:使用Python語言玩轉我的世界

《MINECRAFT編程:使用Python語言玩轉我的世界》是優質的外版引進圖書,適合喜愛Minecraft、願意學習編程的人學習和閱讀。

基本介紹

  • 中文名:MINECRAFT編程:使用Python語言玩轉我的世界
  • 作者:【美】Craig Richardson
  • 譯者:酷課創意教育、季魯
  • 出版社:電子工業出版社
  • 出版時間:2020年4月
  • 頁數:296 頁
  • 定價:118 元
  • 開本:16 開
  • ISBN:9787121383632
內容簡介,圖書目錄,作者簡介,

內容簡介

《MINECRAFT編程:使用Python語言玩轉我的世界》可以幫你在Minecraft中製作出各種各樣有趣的內容,這是你成為一個偉大的程式設計師或Minecraft大師必須邁出的一步。

圖書目錄

第1章 設定你的電腦 ·······················1
準備好你的Windows PC ························· 2
安裝Minecraft ······································ 2
安裝Python ··········································· 3
安裝Java ··············································· 4
安裝Minecraft Python API和Spigot ···· 6
運行外掛程式並創建遊戲·························· 7
重新開始一個新的世界······················ 9
離線遊戲············································10
改為生存模式···································· 11
準備好你的Mac ····································· 12
安裝Minecraft ···································· 13
安裝Python ········································· 15
安裝Java ············································· 15
安裝Minecraft Python API和Spigot····· 16
運行Spigot並創建遊戲 ······················ 18
重新開始一個新的世界···················· 19
離線遊戲············································20
改為生存模式···································· 20
設定你的Raspberry Pi ··························· 21
認識IDLE ··············································· 22
認識Python Shell ······························· 23
和IDLE的文本編輯器問好 ··············· 23
什麼時候使用Python,什麼時候使用文本編輯器 ···························· 25
本書中使用的提示符························ 26
測試你的Minecraft Python是否能運行 ··· 26
第2章 使用變數傳送 ·····················28
什麼是程式············································28
使用變數存儲數據································ 29
程式語言的結構································ 30
變數的語法規則································ 31
如何改變變數的值···························· 32
整數···················································· 32
任務#1 傳送你的角色 ···················· 33
浮點數················································ 38
任務#2 去你想去的地方 ················ 39
使用時間模組降低傳送速度················ 40
任務#3 傳送之旅 ···························· 41
排除bug ··················································43
任務#4 修正一個充滿bug的傳送程式····································· 44
你學到了什麼········································ 46
第3章 利用數學快速搭建和長途旅行 ·······························47
表達式和語句········································ 47
運算符號················································ 48
加法························································· 48
任務#5 堆磚塊 ··································· 49
任務#6 超級跳 ··································· 51
減法························································· 52
任務#7 改變你腳下的磚塊 ·············· 52
在參數中使用數學符號······················· 53
任務#8 快速搭建 ······························· 55
乘法························································· 58
除法························································· 58
任務#9 壯觀的尖塔 ··························· 58
指數························································ 60
括弧和運算順序···································· 61
方便的數學技巧···································· 61
縮略符················································ 61
用隨機數字玩遊戲···························· 62
任務#10 跳到一個新的地方 ·········· 63
你學到了什麼········································ 64
第4章 利用字元串聊天 ················65
什麼是字元串········································ 66
任務#11 你好,Minecraft世界······ 67
任務#12 寫你自己的聊天信息 ······ 69
連線字元串············································71
將數字轉換為字元串························ 71
連線整數與浮點數···························· 72
任務#13 在聊天中加入用戶名 ······ 73
任務#14 使用input命令建立磚塊··· 74
從異常中恢復········································ 76
任務#15 數字通行 ·························· 77
任務#16 神奇的記錄儀 ·················· 79
你學到了什麼········································ 81
第5章 通過布爾運算判斷真假 ···82
布爾運算基礎········································ 83
任務#17 停止打碎磚塊 ·················· 83
關聯布爾運算········································ 84
比較符號················································ 85
等於···················································· 85
任務#18 我在游泳嗎 ······················ 86
不等於················································ 87
任務#19 我沒有站在空氣中嗎 ······ 88
大於和小於········································ 89
大於或等於和小於或等於················ 90
任務#20 我在地面上嗎 ·················· 91
任務#21 我在家附近嗎 ·················· 92
邏輯算符················································ 93
and ·······················94
任務#22 我是否完全在水下 ·········· 95
or ·······················96
任務#23 我在樹上嗎 ······················ 96
not ·······················97
任務#24 這個磚塊不是西瓜嗎 ······ 98
邏輯算符的順序································ 99
我的數字在其他兩個數之間嗎······ 100
任務#25 我在房子裡嗎 ················ 100
你學到了什麼······································ 102
第6章 用if語句做小遊戲···········103
使用if語句 ············································ 104
任務#26 炸出一個坑 ···················· 105
else語句 ············································ 107
任務#27 是否阻止打碎磚塊 ········ 108
elif語句 ············································· 109
任務#28 提供禮物 ························ 111
連線elif語句 ····································· 112
任務#29 傳送到正確的位置 ········ 113
嵌套if語句 ········································ 115
任務#30 開一個秘密通道 ············ 115
用if語句來檢測一個值的範圍 ············ 117
任務#31 限制傳送位置 ················ 118
布爾運算和if語句 ································ 120
任務#32 洗澡 ································ 121
你學到了什麼······································ 123
第7 章 用w h i l e循環製作舞會和花卉遊行·······················124
簡單的while循環 ································· 124
任務#33 隨機的傳送旅程 ············ 126
用變數count控制循環 ························· 128
任務#34 水的詛咒 ························ 129
無限while循環 ································· 130
任務#35 花朵小徑 ························ 131
奇特的條件·········································· 132
任務#36 潛水比賽 ························ 133
布爾運算符和while循環 ················· 135
在while循環中檢測值的範圍 ········· 136
任務#37 做一個舞池 ···················· 136
嵌套if語句和while循環··················· 138
任務#38 點石成金 ························ 139
用break語句來結束while循環············ 140
任務#39 用循環創建永久聊天 ···· 140
while-else語句 ·································· 142
任務#40 熱和冷 ···························· 142
你學到了什麼······································ 145
第8章 函式賜予你超能力 ·········146
定義你自己的函式······························ 147
調用函式·········································· 147
帶有參數的函式······························ 148
任務#41 創建一片森林 ················ 149
重構程式·········································· 151
任務#42 重構 ································ 152
用文檔字元串做注釋······················ 153
參數中的換行符······························ 154
函式返回值······································ 154
任務#43 磚塊ID提醒器················ 156
在函式中使用if語句和while循環······· 157
if語句 ················································ 158
任務#44 羊毛顏色助手 ················ 159
while循環 ········································· 160
任務#45 到處擺放磚塊 ················ 161
全局變數和局部變數·························· 163
任務#46 移動的磚塊 ···················· 164
你學到了什麼······································ 166
第9章 用表和字典擊打東西 ····167
使用表·················································· 168
使用一個表項目······························ 168
改變表項目······································ 169
任務#47 高和低 ···························· 169
操作表·················································· 171
添加項目·········································· 171
插入項目·········································· 172
刪除項目·········································· 173
任務#48 進度條 ···························· 173
把字元串看作表·································· 175
元組······················································ 175
用元組來設定變數·························· 176
任務#49 滑行 ································ 177
返回元組·········································· 178
表的其他有用的特徵·························· 179
表的長度·········································· 179
任務#50 擊打磚塊 ························ 180
隨機選取一個項目·························· 182
任務#51 隨機磚塊 ························ 183
複製表··············································184
項目和if語句 ···································· 185
任務#52 夜視劍 ···························· 186
字典······················································ 188
定義一個字典·································· 188
使用字典中的項目·························· 189
任務#53 觀光指南 ························ 190
在字典中改變或添加項目·············· 191
在字典中刪除項目·························· 192
任務#54 擊打磚塊的分數 ············ 192
你學到了什麼······································ 194
第10章 Minecraft的for循環魔法 ··································195
一個簡單的for循環······························ 195
任務#55 魔杖 ································ 196
任務#56 魔法樓梯 ························ 199
其他表函式·········································· 201
任務#57 柱子 ································ 202
任務#58 金字塔 ···························· 204
循環一個字典······································ 205
任務#59 記分牌 ···························· 206
for-else循環 ·········································· 207
退出for-else循環 ······························ 207
任務#60 鑽石勘探者 ···················· 208
嵌套for循環和多維表·························· 209
考慮兩個維度·································· 209
使用二維表中的值·························· 213
任務#61 像素藝術 ························ 214
用循環生成二維表·························· 216
任務#62 風化剝蝕的牆 ················ 217
考慮三個維度·································· 218
輸出三維表······································ 219
使用三維表中的值·························· 223
任務#63 複製一座建築 ················ 225
學到了什麼·········································· 229
第11章 從檔案及模組中保存和讀取建築 ··················231
使用檔案··············································232
打開一個檔案·································· 232
寫入並保存一個檔案······················ 233
讀取一個檔案·································· 234
讀取檔案中的一行·························· 235
任務#64 提醒單 ···························· 236
第一部分寫提醒單 ······················236
第二部分展示提醒單 ·················· 237
使用模組··············································238
使用pickle模組 ································ 239
導入pickle ········································ 239
使用from語句導入一個函式 ·········· 241
使用*來調用全部的函式 ················ 242
給模組起個“外號”······················ 242
任務#65 保存一座建築 ················ 243
第一部分保存建築 ······················243
第二部分讀取建築 ······················246
使用shelve模組存儲大量數據 ············ 248
使用shelve打開一個檔案 ················ 248
使用shelve添加、修改和
訪問項目······································ 248
任務#66 存儲一系列建築 ············ 249
第一部分將一座建築保存到
收藏夾中······································ 250
第二部分從收藏夾中讀取一座建築 ······································ 250
使用pip安裝新的模組 ························· 253
在Windows中使用pip ······················ 254
在Mac或者樹莓派中使用pip ·········· 255
使用pip安裝的模組:Flask ················ 255
任務#67 位置網站 ························ 257
你學到了什麼······································ 257
第12章 用面向對象編程將程式變優雅 ·······························259
面向對象編程基礎······························ 260
創建一個類·········································· 260
創建一個對象·································· 261
獲取對象屬性·································· 262
任務#68 位置對象 ························ 262
理解方法··············································264
任務#69 幽靈屋 ····························266
方法的返回值······································ 268
任務#70 幽靈城堡 ························ 269
創造多個對象······································ 271
任務#71 幽靈城 ···························· 272
類的屬性··············································273
認識和了解繼承·································· 275
繼承一個類······································ 276
在子類中加入新方法······················ 277
任務#72 幽靈酒店 ························ 278
重寫方法和屬性·································· 280
任務#73 幽靈樹 ···························· 283
你學到了什麼······································ 284

作者簡介

克雷格·理查森(Craig Richardson)是軟體開發人員,Python編程教育家。他曾經在Raspberry Pi基金會工作,曾經在高中教授計算機課程,並開設了許多基於Minecraft的Python編程課程。

相關詞條

熱門詞條

聯絡我們