{"id":452421,"student_id":10,"content":"import game #載入遊戲套件\n\ngame.set_backdrop(\"bg.jpg\") # 設定背景\ngame.create_sound(\"calm.mp3\") # 播放音檔\n\n# 創建三個角色,存在三個變數中\nkoding = game.create_sprite(\"koding.png\")\ncloud1 = game.create_sprite(\"cloud.png\")\ncloud2 = game.create_sprite(\"cloud.png\")\n\n# 設定 cloud1, cloud2 角色的透明度\ncloud1.opacity = 0.8\ncloud2.opacity = 0.7\n\n# 設定 cloud1, cloud2 角色的座標\ncloud1.x = 200\ncloud1.y = 300\ncloud2.x = 400\ncloud2.y = 200\n\n# 設定 cloud1, cloud2, koding 角色的大小\ncloud1.scale = 0.8\ncloud2.scale = 0.6\n\n# 使叩叮不會隨著方向改變而旋轉圖片\nkoding.rotation_style = \"fixed\"\n\n# 定義遊戲迴圈\ndef update():\n\n # 讓雲向右移動\n cloud1.x += 0.5\n cloud2.x += 1\n \n # 當雲超出遊戲場景的右側,重置雲的位置\n if cloud1.x \u003e 1300:\n cloud1.x = -100\n if cloud2.x \u003e 1300:\n cloud2.x = -100\n\n koding.toward(cursor) # 讓叩叮的方向朝向滑鼠移動\n koding.step_forward(3) # 讓叩叮向前移動 像素\n\n# 重複不斷執行遊戲回圈\ngame.forever(update)","created_at":"2022-10-25T13:21:32.706+08:00","updated_at":"2022-10-25T13:21:43.739+08:00","name":"w","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/452421/db8243432cf62c67648f9ce20cb17600.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":158,"hashid":"jzmsk6522","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10245408,"file_name":"cloud.png","project_id":452421,"asset_id":302343,"created_at":"2022-10-25T13:21:32.711+08:00","updated_at":"2022-10-25T13:21:32.711+08:00"},{"id":10245409,"file_name":"bg.jpg","project_id":452421,"asset_id":302344,"created_at":"2022-10-25T13:21:32.712+08:00","updated_at":"2022-10-25T13:21:32.712+08:00"},{"id":10245410,"file_name":"calm.mp3","project_id":452421,"asset_id":302345,"created_at":"2022-10-25T13:21:32.713+08:00","updated_at":"2022-10-25T13:21:32.713+08:00"},{"id":10245411,"file_name":"koding.png","project_id":452421,"asset_id":302346,"created_at":"2022-10-25T13:21:32.714+08:00","updated_at":"2022-10-25T13:21:32.714+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦