{"id":755346,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('sky.png')\nbg = create_sprite('bg.png')\ncow = create_sprite('cow_0.png', 'cow_1.png', 'cow_2.png')\nboy = create_sprite('boy.png')\nrule = create_sprite('rules.png')\nspace = create_sprite('space.png')\n\nclock = 0\n\ndef gamestart():\n rule.hidden = True\n space.hidden = True\n cow.direction = 90\n boy.direction = 90\n boy.y = 450\n bg.x = 600 - 6000\n\ndef loop():\n global clock\n clock += 1\n \n if space.hidden:\n move()\n \n if boy.direction \u003e= 180 or boy.direction \u003c= 0 or bg.x \u003e= 6600:\n space.hidden = False\n \n if boy.y \u003c 800 and not space.hidden and bg.x \u003c 6600:\n boy.y += 5\n\ndef move():\n bg.x += 3\n cow.costume_id = (bg.x // 60) % 3\n level = (bg.x + 5400) // 1200\n if clock % 15 == 0:\n if cow.direction == 90:\n if random() \u003e 0.5:\n cow.direction += 30\n boy.direction += 30\n else:\n cow.direction -= 30\n boy.direction -= 30\n else:\n cow.direction = 90\n \ndef key_right():\n if space.hidden: boy.direction += 30\n\ndef key_left():\n if space.hidden: boy.direction -= 30\n\non('keydown', 'right', key_right)\non('keydown', 'left', key_left)\non('keydown', 'space', gamestart)\nforever(loop)\n\n","created_at":"2024-05-21T11:30:19.171+08:00","updated_at":"2024-06-13T17:16:24.281+08:00","name":"騎公牛大賽","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/755346/010a812c2c6c67ce9d2dd90bd733d61e.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":142,"hashid":"882sn82g8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16867244,"file_name":"cow_1.png","project_id":755346,"asset_id":743141,"created_at":"2024-05-21T11:31:22.507+08:00","updated_at":"2024-05-21T11:31:22.507+08:00"},{"id":16867245,"file_name":"cow_2.png","project_id":755346,"asset_id":743142,"created_at":"2024-05-21T11:31:22.509+08:00","updated_at":"2024-05-21T11:31:22.509+08:00"},{"id":16867242,"file_name":"boy.png","project_id":755346,"asset_id":743139,"created_at":"2024-05-21T11:31:21.021+08:00","updated_at":"2024-05-21T11:31:21.021+08:00"},{"id":16867243,"file_name":"cow_0.png","project_id":755346,"asset_id":743140,"created_at":"2024-05-21T11:31:21.023+08:00","updated_at":"2024-05-21T11:31:21.023+08:00"},{"id":16867246,"file_name":"rules.png","project_id":755346,"asset_id":743143,"created_at":"2024-05-21T11:31:23.414+08:00","updated_at":"2024-05-21T11:31:23.414+08:00"},{"id":16867247,"file_name":"sky.png","project_id":755346,"asset_id":743144,"created_at":"2024-05-21T11:31:23.417+08:00","updated_at":"2024-05-21T11:31:23.417+08:00"},{"id":16867241,"file_name":"bg.png","project_id":755346,"asset_id":743138,"created_at":"2024-05-21T11:30:32.495+08:00","updated_at":"2024-05-21T11:30:32.495+08:00"},{"id":16867249,"file_name":"space.png","project_id":755346,"asset_id":732559,"created_at":"2024-05-21T11:34:29.733+08:00","updated_at":"2024-05-21T11:34:29.733+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦