{"id":720856,"student_id":10,"content":"from game import *\nfrom random import *\n\nbg = create_sprite('bg.png')\ncow = create_sprite('cow_0.png', 'cow_1.png')\nboy = create_sprite('boy_0.png')\ninfo = create_sprite('rules.png')\nspace = create_sprite('end.png')\n\nclock = 0\nspace.scale = 0.8\nspace.y += 100\n\ndef start_game():\n global clock\n cow.direction = 90\n boy.direction = 90\n boy.y = 450\n clock = 0\n info.hidden = True\n space.hidden = True\n\ndef loop():\n global clock\n \n if not info.hidden: return\n \n if space.hidden: \n clock += 1\n level = clock // 60\n if level \u003e 20: level = 20\n \n draw_text(str(clock // 60) + 'sec', 500, 100, 'red', 100)\n \n cow.costume_id = (clock // 30) % 2\n \n if space.hidden:\n bg.x += 1\n if bg.x \u003e 1200: bg.x -= 1200\n \n if clock % (30 - level) == 0 and space.hidden:\n if cow.direction == 90:\n if random() \u003c 0.5:\n if random () \u003c 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 \n if boy.direction \u003c= 0 or boy.direction \u003e= 180:\n space.hidden = False\n info.costume_id = 1\n \n if not space.hidden and boy.y \u003c 700:\n boy.y += 5\n\ndef key_right():\n if space.hidden:\n boy.direction += 30\n\ndef key_left():\n if space.hidden:\n boy.direction -= 30\n\ninfo.on('click', start_game)\non('keyup', 'right', key_right)\non('keyup', 'left', key_left)\non('keyup', 'space', start_game)\nforever(loop)\n\n\n","created_at":"2024-03-26T12:31:04.723+08:00","updated_at":"2024-05-21T11:13:14.791+08:00","name":"騎牛大賽","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/720856/d7f72eb85f77b49e3fb4f79f33aa33bb.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":74,"hashid":"meys98pek","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16235935,"file_name":"bg.png","project_id":720856,"asset_id":732555,"created_at":"2024-04-08T17:49:39.723+08:00","updated_at":"2024-04-08T17:49:39.723+08:00"},{"id":16235936,"file_name":"boy_0.png","project_id":720856,"asset_id":732556,"created_at":"2024-04-08T17:49:39.725+08:00","updated_at":"2024-04-08T17:49:39.725+08:00"},{"id":16235939,"file_name":"end.png","project_id":720856,"asset_id":732559,"created_at":"2024-04-08T17:49:41.472+08:00","updated_at":"2024-04-08T17:49:41.472+08:00"},{"id":16235940,"file_name":"rules.png","project_id":720856,"asset_id":732560,"created_at":"2024-04-08T17:49:41.473+08:00","updated_at":"2024-04-08T17:49:41.473+08:00"},{"id":16235937,"file_name":"cow_0.png","project_id":720856,"asset_id":732557,"created_at":"2024-04-08T17:49:40.828+08:00","updated_at":"2024-04-08T17:49:40.828+08:00"},{"id":16235938,"file_name":"cow_1.png","project_id":720856,"asset_id":732558,"created_at":"2024-04-08T17:49:40.830+08:00","updated_at":"2024-04-08T17:49:40.830+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦