{"id":781587,"student_id":10,"content":"from game import *\n\nbg = create_sprite('bg.png')\nright = create_sprite('pie_y.png')\nleft = create_sprite('pie_b.png')\nplayer = create_sprite('koding.png')\n\nright.opacity = 0.1\nleft.opacity = 0.1\nplayer.direction = 0\nplayer.scale = 0.7\nvx = 0\nvy = -40\nstart = True\ndiff = 0\nscore = 0\nscale = 1\nleft.direction += 180\n\ndef loop():\n global diff, vx, vy, start, score, scale\n \n draw_text(score, 30, 60, 'red', 100)\n \n if start:\n bg.x -= vx / 3\n bg.y -= vy / 3\n vy += 1 / 3\n if bg.y \u003c= 450:\n vy = -vy\n scale += 0.01\n if player.direction \u003e= 0 and player.direction \u003c= 90:\n vx = player.direction / 10\n vy += vx\n elif player.direction \u003e 270:\n vx = -(360 - player.direction) / 10\n vy -= vx\n else:\n stop()\n \n if abs(player.x - bg.x) \u003e 300:\n stop()\n \n right.hidden = not cursor.is_down\n left.hidden = not cursor.is_down \n \n if cursor.is_down:\n player.toward(cursor)\n \n if right.touched(cursor):\n right.direction += 60\n left.direction += 60\n diff += 60\n \n if left.touched(cursor):\n right.direction -= 60\n left.direction -= 60\n diff -= 60\n \n if diff == 360 or diff == -360:\n score += 1\n diff = 0\n\nforever(loop)","created_at":"2024-07-01T14:31:58.496+08:00","updated_at":"2024-07-05T11:31:07.406+08:00","name":"體操","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/781587/4feb53d4b26d3acf163f792e0141b9f0.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":54,"hashid":"4y3s3dpr2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17407584,"file_name":"pie.png","project_id":781587,"asset_id":752109,"created_at":"2024-07-01T15:43:00.817+08:00","updated_at":"2024-07-01T15:43:00.817+08:00"},{"id":17407578,"file_name":"circle.png","project_id":781587,"asset_id":752104,"created_at":"2024-07-01T15:22:44.375+08:00","updated_at":"2024-07-01T15:22:44.375+08:00"},{"id":17407562,"file_name":"bg.png","project_id":781587,"asset_id":752103,"created_at":"2024-07-01T15:04:59.216+08:00","updated_at":"2024-07-01T15:04:59.216+08:00"},{"id":17407535,"file_name":"koding.png","project_id":781587,"asset_id":752102,"created_at":"2024-07-01T14:48:09.121+08:00","updated_at":"2024-07-01T14:48:09.121+08:00"},{"id":17407591,"file_name":"pie_b.png","project_id":781587,"asset_id":752112,"created_at":"2024-07-01T16:00:25.550+08:00","updated_at":"2024-07-01T16:00:25.550+08:00"},{"id":17407592,"file_name":"pie_y.png","project_id":781587,"asset_id":752113,"created_at":"2024-07-01T16:00:25.551+08:00","updated_at":"2024-07-01T16:00:25.551+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦