{"id":138311,"student_id":10,"content":"import random\n\nroad = createSprite(\"road.png\")\nplayer = createSprite(\"player_0.png\",\"player_1.png\",\"player_2.png\")\nblock = createSprite(\"b_0.png\",\"b_1.png\",\"b_2.png\",\"b_3.png\",\"b_4.png\",\"b_5.png\")\ncloud = createSprite(\"cloud.png\")\n\ncreateSound('bgm.mp3', True)\n\nblock.x += 1000\nroad.y = 250\ncloud.y = 100\n\nscore = 0 #分數\nspeed = 5 #水平速度\nvy = 0 #垂直速度\n\ndef loop():\n moveGound()\n movePlayer()\n moveBlocks()\n moveCloud()\n showInfo()\n \ndef moveGound():\n road.x -= speed\n if road.x \u003c 0:\n road.x += 1200\n\ndef movePlayer():\n global vy\n vy += 1\n if key.space and player.y == 240:\n vy = -17\n createSound('jump.ogg')\n player.y += vy\n if player.y \u003e 240:\n player.y = 240\n if player.touched(block):\n stop()\n \n if score%6 \u003e 3:\n player.costumeId = 1\n else:\n player.costumeId = 2\n\ndef moveBlocks():\n block.x -= speed\n if block.x \u003c -100:\n block.x += 1000 + random.random()*500\n block.costumeId = random.randrange(0, 6)\n\ndef moveCloud():\n cloud.x -= speed/3\n if cloud.x \u003c -100:\n cloud.x += 1000\n cloud.y = random.random()*50 + 50\n\ndef showInfo():\n global score, speed\n score += 1\n drawText('score: '+str(score), 10, 10)\n speed = 5 + int(score/500)\n if score%500 == 0:\n createSound('milestone.mp3')\n\nforever(loop)","created_at":"2020-04-01T11:14:11.956+08:00","updated_at":"2020-09-18T10:52:11.956+08:00","name":"小恐龍 python","language":"python","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/138311/9ded184602a2909f9122118fe2083e54.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":394,"hashid":"jzmsmgjr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2382424,"file_name":"bird_0.png","project_id":138311,"asset_id":202045,"created_at":"2020-04-01T11:14:32.400+08:00","updated_at":"2020-04-01T11:14:32.400+08:00"},{"id":2382425,"file_name":"bird_1.png","project_id":138311,"asset_id":202046,"created_at":"2020-04-01T11:14:32.401+08:00","updated_at":"2020-04-01T11:14:32.401+08:00"},{"id":2382419,"file_name":"b_1.png","project_id":138311,"asset_id":202040,"created_at":"2020-04-01T11:14:31.592+08:00","updated_at":"2020-04-01T11:14:31.592+08:00"},{"id":2382420,"file_name":"b_2.png","project_id":138311,"asset_id":202041,"created_at":"2020-04-01T11:14:31.811+08:00","updated_at":"2020-04-01T11:14:31.811+08:00"},{"id":2382421,"file_name":"b_3.png","project_id":138311,"asset_id":202042,"created_at":"2020-04-01T11:14:31.813+08:00","updated_at":"2020-04-01T11:14:31.813+08:00"},{"id":2382422,"file_name":"b_4.png","project_id":138311,"asset_id":202043,"created_at":"2020-04-01T11:14:32.098+08:00","updated_at":"2020-04-01T11:14:32.098+08:00"},{"id":2382423,"file_name":"b_5.png","project_id":138311,"asset_id":202044,"created_at":"2020-04-01T11:14:32.100+08:00","updated_at":"2020-04-01T11:14:32.100+08:00"},{"id":2382467,"file_name":"bgm.mp3","project_id":138311,"asset_id":202056,"created_at":"2020-04-01T12:03:38.851+08:00","updated_at":"2020-04-01T12:03:38.851+08:00"},{"id":2382430,"file_name":"player_3.png","project_id":138311,"asset_id":202051,"created_at":"2020-04-01T11:14:33.057+08:00","updated_at":"2020-04-01T11:14:33.057+08:00"},{"id":2382431,"file_name":"player_4.png","project_id":138311,"asset_id":202052,"created_at":"2020-04-01T11:14:33.059+08:00","updated_at":"2020-04-01T11:14:33.059+08:00"},{"id":2382426,"file_name":"cloud.png","project_id":138311,"asset_id":202047,"created_at":"2020-04-01T11:14:32.619+08:00","updated_at":"2020-04-01T11:14:32.619+08:00"},{"id":2382427,"file_name":"player_0.png","project_id":138311,"asset_id":202048,"created_at":"2020-04-01T11:14:32.622+08:00","updated_at":"2020-04-01T11:14:32.622+08:00"},{"id":2382428,"file_name":"player_1.png","project_id":138311,"asset_id":202049,"created_at":"2020-04-01T11:14:32.848+08:00","updated_at":"2020-04-01T11:14:32.848+08:00"},{"id":2382429,"file_name":"player_2.png","project_id":138311,"asset_id":202050,"created_at":"2020-04-01T11:14:32.850+08:00","updated_at":"2020-04-01T11:14:32.850+08:00"},{"id":2382459,"file_name":"road.png","project_id":138311,"asset_id":202054,"created_at":"2020-04-01T11:17:34.091+08:00","updated_at":"2020-04-01T11:17:34.091+08:00"},{"id":2382465,"file_name":"jump.ogg","project_id":138311,"asset_id":172839,"created_at":"2020-04-01T12:00:47.800+08:00","updated_at":"2020-04-01T12:00:47.800+08:00"},{"id":2382466,"file_name":"milestone.mp3","project_id":138311,"asset_id":202055,"created_at":"2020-04-01T12:00:47.803+08:00","updated_at":"2020-04-01T12:00:47.803+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦