{"id":265109,"student_id":34,"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.png','2.png','3.png','4.png','war_sentouki_noman.png') #1號障礙物\nb2 = game.create_sprite('0.png','1.png','2.png','3.png','4.png','war_sentouki_noman.png') #2號障礙物\nb3 = game.create_sprite('0.png','1.png','2.png','3.png','4.png','war_sentouki_noman.png') #3號障礙物\nboard = game.create_sprite('board.png') #計分版\nhint = game.create_sprite(\"hint.png\") #創造角色\ngame.create_sound('bgm.mp3',True)\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 #分數\nlive = 3 #生命\n\n#遊戲主迴圈\ndef loop():\n global vx, vy, score,live #存取函式外變數\n \n if hint.hidden == True:\n ground.x -= vx\n b1.x -= vx * 1.3\n b2.x -= vx * 1.3\n b3.x -= vx * 1.3\n \n if ground.x \u003c 0:\n ground.x += 3000\n \n if b1.x \u003c -100:\n b1.x = b3.x + random.randrange(400,1000) * vx / 10\n b1.costume_id = random.randrange(6)\n \n if b2.x \u003c -100:\n b2.x = b1.x + random.randrange(400,1000) * vx / 10\n b2.costume_id = random.randrange(6)\n \n if b3.x \u003c -100:\n b3.x = b2.x + random.randrange(400,1000) * vx / 10\n b3.costume_id = random.randrange(6)\n \n dino.y += vy\n vy += 2\n \n if dino.y \u003e 600:\n dino.y = 600\n \n if hint.hidden == True:\n if game.key.space == True and dino.y == 600:\n vy = -30\n game.create_sound('jump.ogg')\n \n if dino.touched(b1) == True or dino.touched(b2) == True or dino.touched(b3) == True:\n b1.x = 2000\n b2.x = 2500\n b3.x = 3000\n hint.hidden = False\n live -= 1\n if live == 0:\n game.draw_text('GAME OVER',310,450,'black',100)\n game.stop()\n \n if hint.hidden == True: \n score += 1/6\n \n game.draw_text(int(score),30,30,'black',60)\n game.draw_text(live,1100,30,'black',60)\n \n if hint.hidden == True:\n dino.costume_id = int(score) % 2 \n \n if int(score) % 300 \u003c 150:\n game.set_backdrop(\"sky_light.png\") #設定背景\n \n else:\n game.set_backdrop(\"sky_dark.png\") #設定背景\n \n vx = 10 + score / 100\n \n if game.key.enter == True and hint.hidden == False:\n hint.hidden = True\n score = 0 \n \n if b1.costume_id == 5:b1.y = 500\n else:b1.y = 600\n if b2.costume_id == 5:b2.y = 500\n else:b2.y = 600\n if b3.costume_id == 5:b3.y = 500\n else:b3.y = 600\n\ngame.forever(loop) #重複不斷執行\n","created_at":"2021-06-24T19:07:07.877+08:00","updated_at":"2021-07-22T17:15:26.655+08:00","name":"小恐龍大爆走(預設版) 副本","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/265109/d1df25b2738683732bd80fb77933492e.jpg"},"parent_id":194471,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":106,"hashid":"rdvs6m5v3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":5101224,"file_name":"jump.ogg","project_id":265109,"asset_id":267853,"created_at":"2021-06-24T19:07:07.882+08:00","updated_at":"2021-06-24T19:07:07.882+08:00"},{"id":5101225,"file_name":"milestone.mp3","project_id":265109,"asset_id":267854,"created_at":"2021-06-24T19:07:07.883+08:00","updated_at":"2021-06-24T19:07:07.883+08:00"},{"id":5101226,"file_name":"bgm.mp3","project_id":265109,"asset_id":267855,"created_at":"2021-06-24T19:07:07.884+08:00","updated_at":"2021-06-24T19:07:07.884+08:00"},{"id":5101227,"file_name":"0.png","project_id":265109,"asset_id":267856,"created_at":"2021-06-24T19:07:07.885+08:00","updated_at":"2021-06-24T19:07:07.885+08:00"},{"id":5101228,"file_name":"2.png","project_id":265109,"asset_id":267857,"created_at":"2021-06-24T19:07:07.887+08:00","updated_at":"2021-06-24T19:07:07.887+08:00"},{"id":5101229,"file_name":"3.png","project_id":265109,"asset_id":267858,"created_at":"2021-06-24T19:07:07.887+08:00","updated_at":"2021-06-24T19:07:07.887+08:00"},{"id":5101230,"file_name":"4.png","project_id":265109,"asset_id":267859,"created_at":"2021-06-24T19:07:07.889+08:00","updated_at":"2021-06-24T19:07:07.889+08:00"},{"id":5101231,"file_name":"sky_dark.png","project_id":265109,"asset_id":267860,"created_at":"2021-06-24T19:07:07.890+08:00","updated_at":"2021-06-24T19:07:07.890+08:00"},{"id":5101232,"file_name":"board.png","project_id":265109,"asset_id":267861,"created_at":"2021-06-24T19:07:07.891+08:00","updated_at":"2021-06-24T19:07:07.891+08:00"},{"id":5101233,"file_name":"dino_0.png","project_id":265109,"asset_id":267862,"created_at":"2021-06-24T19:07:07.892+08:00","updated_at":"2021-06-24T19:07:07.892+08:00"},{"id":5101234,"file_name":"dino_1.png","project_id":265109,"asset_id":267863,"created_at":"2021-06-24T19:07:07.893+08:00","updated_at":"2021-06-24T19:07:07.893+08:00"},{"id":5101235,"file_name":"hint.png","project_id":265109,"asset_id":267864,"created_at":"2021-06-24T19:07:07.894+08:00","updated_at":"2021-06-24T19:07:07.894+08:00"},{"id":5101236,"file_name":"bg.png","project_id":265109,"asset_id":267865,"created_at":"2021-06-24T19:07:07.895+08:00","updated_at":"2021-06-24T19:07:07.895+08:00"},{"id":5101237,"file_name":"sky_light.png","project_id":265109,"asset_id":267866,"created_at":"2021-06-24T19:07:07.896+08:00","updated_at":"2021-06-24T19:07:07.896+08:00"},{"id":5101238,"file_name":"ground.png","project_id":265109,"asset_id":267867,"created_at":"2021-06-24T19:07:07.897+08:00","updated_at":"2021-06-24T19:07:07.897+08:00"},{"id":5101239,"file_name":"1.png","project_id":265109,"asset_id":267868,"created_at":"2021-06-24T19:07:07.898+08:00","updated_at":"2021-06-24T19:07:07.898+08:00"},{"id":5431249,"file_name":"war_sentouki_noman.png","project_id":265109,"asset_id":386163,"created_at":"2021-07-22T17:10:43.072+08:00","updated_at":"2021-07-22T17:10:43.072+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦