{"id":335306,"student_id":10,"content":"import game #載入遊戲套件\nimport random #載入隨機數套件\n\nground = game.create_sprite('ground.png') #道路街景\ndino = game.create_sprite('dino_0.png', 'dino_1.png') #恐龍\nb1 = game.create_sprite('0.png') #1號障礙物\nb2 = game.create_sprite('0.png') #2號障礙物\nb3 = game.create_sprite('0.png') #3號障礙物\nboard = game.create_sprite('board.png') #計分版\n\ndino.y = 600\nb1.y = 600\nb2.y = 600\nb3.y = 600\n\ndino.x = 300\nb1.x = 2000\nb2.x = 2500\nb3.x = 3000\n\nvy = 0 #垂直速度\nvx = 10 #水平速度\nscore = 0 #分數\n\n#遊戲主迴圈\ndef loop():\n global vx, vy, score #存取函式外變數\n \n # 背景與障礙物不斷向左移動\n ground.x -= vx\n b1.x -= vx * 1.2\n b2.x -= vx * 1.2\n b3.x -= vx * 1.2\n \n if ground.x \u003c= -1200:\n ground.x += 3000\n \n if b1.x \u003c -100:\n b1.x = b3.x + random.randrange(400, 1000)\n \n if b2.x \u003c -100:\n b2.x = b1.x + random.randrange(400, 1000)\n \n if b3.x \u003c -100:\n b3.x = b2.x + random.randrange(400, 1000)\n\n\n\n\ngame.forever(loop) #重複不斷執行","created_at":"2022-01-13T18:14:46.481+08:00","updated_at":"2022-01-25T17:18:27.451+08:00","name":"小恐龍大爆走(預設版) ","language":"python","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/335306/7fef5b386c58cea939312caa16c6e5a7.jpg"},"parent_id":194471,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":262,"hashid":"2pds96p3d","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":7147736,"file_name":"jump.ogg","project_id":335306,"asset_id":267853,"created_at":"2022-01-13T18:14:46.486+08:00","updated_at":"2022-01-13T18:14:46.486+08:00"},{"id":7147737,"file_name":"milestone.mp3","project_id":335306,"asset_id":267854,"created_at":"2022-01-13T18:14:46.488+08:00","updated_at":"2022-01-13T18:14:46.488+08:00"},{"id":7147738,"file_name":"bgm.mp3","project_id":335306,"asset_id":267855,"created_at":"2022-01-13T18:14:46.489+08:00","updated_at":"2022-01-13T18:14:46.489+08:00"},{"id":7147739,"file_name":"0.png","project_id":335306,"asset_id":267856,"created_at":"2022-01-13T18:14:46.490+08:00","updated_at":"2022-01-13T18:14:46.490+08:00"},{"id":7147740,"file_name":"2.png","project_id":335306,"asset_id":267857,"created_at":"2022-01-13T18:14:46.491+08:00","updated_at":"2022-01-13T18:14:46.491+08:00"},{"id":7147741,"file_name":"3.png","project_id":335306,"asset_id":267858,"created_at":"2022-01-13T18:14:46.493+08:00","updated_at":"2022-01-13T18:14:46.493+08:00"},{"id":7147742,"file_name":"4.png","project_id":335306,"asset_id":267859,"created_at":"2022-01-13T18:14:46.494+08:00","updated_at":"2022-01-13T18:14:46.494+08:00"},{"id":7147743,"file_name":"sky_dark.png","project_id":335306,"asset_id":267860,"created_at":"2022-01-13T18:14:46.495+08:00","updated_at":"2022-01-13T18:14:46.495+08:00"},{"id":7147744,"file_name":"board.png","project_id":335306,"asset_id":267861,"created_at":"2022-01-13T18:14:46.497+08:00","updated_at":"2022-01-13T18:14:46.497+08:00"},{"id":7147745,"file_name":"dino_0.png","project_id":335306,"asset_id":267862,"created_at":"2022-01-13T18:14:46.497+08:00","updated_at":"2022-01-13T18:14:46.497+08:00"},{"id":7147746,"file_name":"dino_1.png","project_id":335306,"asset_id":267863,"created_at":"2022-01-13T18:14:46.498+08:00","updated_at":"2022-01-13T18:14:46.498+08:00"},{"id":7147747,"file_name":"hint.png","project_id":335306,"asset_id":267864,"created_at":"2022-01-13T18:14:46.500+08:00","updated_at":"2022-01-13T18:14:46.500+08:00"},{"id":7147748,"file_name":"bg.png","project_id":335306,"asset_id":267865,"created_at":"2022-01-13T18:14:46.501+08:00","updated_at":"2022-01-13T18:14:46.501+08:00"},{"id":7147749,"file_name":"sky_light.png","project_id":335306,"asset_id":267866,"created_at":"2022-01-13T18:14:46.502+08:00","updated_at":"2022-01-13T18:14:46.502+08:00"},{"id":7147750,"file_name":"ground.png","project_id":335306,"asset_id":267867,"created_at":"2022-01-13T18:14:46.504+08:00","updated_at":"2022-01-13T18:14:46.504+08:00"},{"id":7147751,"file_name":"1.png","project_id":335306,"asset_id":267868,"created_at":"2022-01-13T18:14:46.505+08:00","updated_at":"2022-01-13T18:14:46.505+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦