{"id":190123,"student_id":10,"content":"import game #載入遊戲套件\nimport random #載入隨機數套件\n\nground = game.create_sprite('bg.png') #道路\ndino = game.create_sprite('dino_0.png', 'dino_1.png') #恐龍\nb1 = game.create_sprite('1.png', '2.png', '3.png', '4.png', '5.png')\nb2 = game.create_sprite('1.png', '2.png', '3.png', '4.png', '5.png')\nhint = game.create_sprite(\"hint.png\")\nboard = game.create_sprite(\"board.png\")\n\ndino.x = 300\ndino.y = 600\nb1.x = 1800\nb1.y = 600\nb2.x = 2400\nb2.y = 600\n\nvy = 0\nvx = 10\nscore = 0\n\n\nhint.y += 300\n\ngame.create_sound(\"bgm.mp3\", True)\n\ndef loop():\n global vy, score, vx\n \n if hint.hidden:\n ground.x -= vx\n b1.x -= vx * 1.25\n b2.x -= vx * 1.25\n dino.costume_id = int(score) % 2\n\n if ground.x \u003c= -1200:\n ground.x += 3000\n \n if b1.x \u003c -50:\n b1.x = b2.x + random.randrange(600, 900) * vx / 10\n b1.costume_id = random.randrange(5)\n \n if b2.x \u003c -50:\n b2.x = b1.x + random.randrange(600, 900) * vx / 10\n b2.costume_id = random.randrange(5)\n \n if key.space and dino.y == 600:\n vy = -30\n game.create_sound(\"jump.ogg\")\n \n vy += 2\n dino.y += vy\n \n if dino.y \u003e 600:\n dino.y = 600\n \n if dino.touched(b1) or dino.touched(b2):\n hint.hidden = False\n \n if hint.hidden:\n score += 1/6\n vx = 10 + score/100\n \n if key.enter:\n hint.hidden = True\n b1.x = 1800\n b2.x = 2400\n vx = 10\n score = 0\n \n if score % 200 \u003e 100:\n game.set_backdrop(\"#111\")\n else:\n game.set_backdrop(\"white\")\n\n game.draw_text(int(score), 40, 40, 'black', 60)\n\ngame.forever(loop)\n","created_at":"2020-09-09T23:55:04.416+08:00","updated_at":"2020-09-21T16:13:02.236+08:00","name":"小恐龍","language":"python","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/190123/0716f1d695d89a6e20b1b1b549b60eab.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":228,"hashid":"kdmsr4jd","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3311958,"file_name":"3.png","project_id":190123,"asset_id":264579,"created_at":"2020-09-21T10:39:05.071+08:00","updated_at":"2020-09-21T10:39:05.071+08:00"},{"id":3311959,"file_name":"4.png","project_id":190123,"asset_id":264580,"created_at":"2020-09-21T10:39:05.073+08:00","updated_at":"2020-09-21T10:39:05.073+08:00"},{"id":3311963,"file_name":"dino_0.png","project_id":190123,"asset_id":264584,"created_at":"2020-09-21T10:39:06.703+08:00","updated_at":"2020-09-21T10:39:06.703+08:00"},{"id":3311964,"file_name":"dino_1.png","project_id":190123,"asset_id":264585,"created_at":"2020-09-21T10:39:07.215+08:00","updated_at":"2020-09-21T10:39:07.215+08:00"},{"id":3311960,"file_name":"5.png","project_id":190123,"asset_id":264581,"created_at":"2020-09-21T10:39:06.225+08:00","updated_at":"2020-09-21T10:39:06.225+08:00"},{"id":3311961,"file_name":"bg.png","project_id":190123,"asset_id":264582,"created_at":"2020-09-21T10:39:06.227+08:00","updated_at":"2020-09-21T10:39:06.227+08:00"},{"id":3311954,"file_name":"_bg.png","project_id":190123,"asset_id":264575,"created_at":"2020-09-21T10:39:03.950+08:00","updated_at":"2020-09-21T10:39:03.950+08:00"},{"id":3311955,"file_name":"0.png","project_id":190123,"asset_id":264576,"created_at":"2020-09-21T10:39:03.953+08:00","updated_at":"2020-09-21T10:39:03.953+08:00"},{"id":3311969,"file_name":"hint.png","project_id":190123,"asset_id":264587,"created_at":"2020-09-21T11:13:06.250+08:00","updated_at":"2020-09-21T11:13:06.250+08:00"},{"id":3311956,"file_name":"1.png","project_id":190123,"asset_id":264577,"created_at":"2020-09-21T10:39:04.422+08:00","updated_at":"2020-09-21T10:39:04.422+08:00"},{"id":3311957,"file_name":"2.png","project_id":190123,"asset_id":264578,"created_at":"2020-09-21T10:39:04.424+08:00","updated_at":"2020-09-21T10:39:04.424+08:00"},{"id":3311966,"file_name":"bgm.mp3","project_id":190123,"asset_id":202056,"created_at":"2020-09-21T11:08:46.489+08:00","updated_at":"2020-09-21T11:08:46.489+08:00"},{"id":3311967,"file_name":"milestone.mp3","project_id":190123,"asset_id":202055,"created_at":"2020-09-21T11:09:16.970+08:00","updated_at":"2020-09-21T11:09:16.970+08:00"},{"id":3311968,"file_name":"jump.ogg","project_id":190123,"asset_id":172839,"created_at":"2020-09-21T11:09:18.173+08:00","updated_at":"2020-09-21T11:09:18.173+08:00"},{"id":3311970,"file_name":"board.png","project_id":190123,"asset_id":264588,"created_at":"2020-09-21T11:15:45.791+08:00","updated_at":"2020-09-21T11:15:45.791+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦