{"id":194702,"student_id":10,"content":"import game\n\nroad = game.create_sprite('road.jpg') #跑道\nplayer = game.create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png') #玩家\nboard = game.create_sprite('dashboard.png') #分數板子\n\nboard.x = 150\nboard.y = 50\nroad.x += 2000\n\nvx = 0 #移動速度\nvy = 0 #跳躍速度\n\ngame.create_sound('bgm.mp3', True)\n\n#遊戲主迴圈\ndef loop ():\n global vy, vx\n \n road.x -= vx\n if vx \u003e 0: vx -= 0.001\n \n vy += 0.5\n player.y += vy\n if player.y \u003e 450: player.y = 450\n \n if road.x \u003c 600 and player.y \u003e= 450:\n player.costume_id = 3\n game.stop()\n game.create_sound('applause.wav')\n \n if road.x \u003c 600:\n distenace = int(450 - road.x) / 100\n game.draw_text(str(distenace) + 'm', 30, 30, 'white', 60)\n else:\n player.costume_id = int(road.x / 100) % 2\n\n#助跑\ndef speedup ():\n global vx\n if vx \u003c 0: vx = 3\n else: vx += 1\n\n#起跳\ndef jump ():\n global vy\n if player.y == 450: vy = -vx\n player.costume_id = 2\n \n\ngame.forever(loop) #重複不斷執行遊戲主迴圈\ngame.on('keyup', 'right', speedup) #按下右鍵時助跑\ngame.on('keyup', 'up', jump) #按下上鍵時起跳\n","created_at":"2020-10-12T17:35:28.140+08:00","updated_at":"2024-03-19T15:58:59.339+08:00","name":"運動會系列 - 跳遠競賽(預設版)","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/194702/16db03e67216df1cd6c572c09daa7135.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":232,"hashid":"d5msvww8k","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3590510,"file_name":"dashboard.png","project_id":194702,"asset_id":284917,"created_at":"2020-11-25T16:58:00.401+08:00","updated_at":"2020-11-25T16:58:00.401+08:00"},{"id":3590511,"file_name":"road.jpg","project_id":194702,"asset_id":284918,"created_at":"2020-11-25T16:58:00.402+08:00","updated_at":"2020-11-25T16:58:00.402+08:00"},{"id":3590518,"file_name":"p_2.png","project_id":194702,"asset_id":284921,"created_at":"2020-11-25T17:04:51.124+08:00","updated_at":"2020-12-05T11:29:48.848+08:00"},{"id":3590517,"file_name":"p_1.png","project_id":194702,"asset_id":284920,"created_at":"2020-11-25T17:04:50.322+08:00","updated_at":"2020-12-05T11:29:51.481+08:00"},{"id":3590516,"file_name":"p_0.png","project_id":194702,"asset_id":284919,"created_at":"2020-11-25T17:04:50.320+08:00","updated_at":"2020-12-05T11:29:54.295+08:00"},{"id":3590611,"file_name":"applause.wav","project_id":194702,"asset_id":284957,"created_at":"2020-11-25T17:47:57.090+08:00","updated_at":"2020-11-25T17:47:57.090+08:00"},{"id":3590612,"file_name":"bgm.mp3","project_id":194702,"asset_id":284958,"created_at":"2020-11-25T17:47:57.091+08:00","updated_at":"2020-11-25T17:47:57.091+08:00"},{"id":3590519,"file_name":"p_3.png","project_id":194702,"asset_id":284922,"created_at":"2020-11-25T17:04:51.125+08:00","updated_at":"2020-12-05T11:29:45.535+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦