{"id":51935,"student_id":10,"content":"# 引入遊戲模組:\nimport game\n\n# 設定背景:\ngame.setBackdrop(\"bg.jpg\")\n\n# 播放音檔:\ngame.sound.play(\"calm.mp3\")\n\n# 創建三個角色,存在三個變數中:\nkoding = game.createSprite(\"koding.png\")\ncloud1 = game.createSprite(\"cloud.png\")\ncloud2 = game.createSprite(\"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 # 設定為原本圖片的 0.8 倍\ncloud2.scale = 0.6 # 設定為原本圖片的 0.6 倍\nkoding.scale = 0.8 # 設定為原本圖片的 0.8 倍\n\n# 使叩叮不會隨著方向改變而旋轉圖片:\nkoding.rotationStyle = 'fixed'\n\n# 宣告遊戲迴圈的函式:\ndef update():\n # cloud1 向右邊移動 0.2:\n cloud1.x += 0.3\n \n # cloud2 向右邊移動 0.4:\n cloud2.x += 0.4\n \n # 如果 cloud1 y座標移動超過 700,將y座標改為-100:\n if cloud1.x \u003e 700:\n cloud1.x = -100\n \n # 如果 cloud2 y座標移動超過 700,將y座標改為-100:\n if cloud2.x \u003e 700:\n cloud2.x = -100\n \n # 讓叩叮的方向朝向滑鼠:\n koding.toward(game.cursor)\n \n # 讓叩叮向前移動 1 像素:\n koding.stepForward(1)\n\n# 重複不斷執行 update 函式:\ngame.forever(update)\n\n","created_at":"2018-12-11T12:52:06.982+08:00","updated_at":"2019-11-11T19:25:54.876+08:00","name":"zz","language":"python","screenshot":{"url":"/uploads/project/screenshot/51935/dffaa1efbf830aead4222db94e926afa.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":505,"hashid":"jzmsr38k","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":926784,"file_name":"calm.mp3","project_id":51935,"asset_id":103493,"created_at":"2018-12-11T12:52:07.005+08:00","updated_at":"2018-12-11T12:52:07.005+08:00"},{"id":926785,"file_name":"koding.png","project_id":51935,"asset_id":103492,"created_at":"2018-12-11T12:52:07.008+08:00","updated_at":"2018-12-11T12:52:07.008+08:00"},{"id":926786,"file_name":"bg.jpg","project_id":51935,"asset_id":103491,"created_at":"2018-12-11T12:52:07.010+08:00","updated_at":"2018-12-11T12:52:07.010+08:00"},{"id":926787,"file_name":"cloud.png","project_id":51935,"asset_id":103490,"created_at":"2018-12-11T12:52:07.011+08:00","updated_at":"2018-12-11T12:52:07.011+08:00"}]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Screenshot
繁中
简中
English
日本語
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer