{"id":47196,"student_id":10,"content":"import game\n\n# # 1. 我们别让战机这么靠前吧,好危险呀!\n\ndef update():\n \n# # 2. 名字很重要,取个酷炫一点的名字吧!\n game.print(\"谁的战斗机?\", 20, 20, \"black\")\n \n# # 3. 只能前进的战机是活不长的,快让他动起来吧!\n# if game.key.up==True:\n# fighter.y = fighter.y - 4\n# if game.key.down==True:\n# # 如何让战机后退呢?\n# fighter.y\n# if game.key.right==True:\n# # 如何让战机右移呢?\n# fighter.x\n# if game.key.left==True:\n# # 如何让战机左移呢?\n# fighter.x\ngame.forever(update)\n\n# ##=== 挑战题:\n# ## 1. 为战机的名字换一个特别的颜色吧!\n# ## 2. 更改一下战机的速度,让他飞得更快或更慢一点!\n\n","created_at":"2018-11-01T13:29:43.398+08:00","updated_at":"2020-01-27T20:56:11.530+08:00","name":"太空大战 (学生版) 副本","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/47196/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":46418,"plugin":"# import game\n# import math\n# import random\n# import time\n\n# _time = time\n# START_AT = _time.time()\n\n# _timer = 0\n# _explode_at = START_AT\n# game.setBackdrop(\"bg.jpg\",0,0,640,480)\n# game.sound.play('Arcade-Fantasy.mp3',True)\n# fighter = game.createSprite([\"fighter_1.png\",\"fighter_2.png\",\"fighter_damaged.png\"])\n# fighter.scale = 0.6\n# fighter.y = 200\n# fighter.layer = 999\n# fighter._last_shot_at = 0\n# fighter.life = 3\n# fighter.damage_countdown = 0\n\n# enemies = []\n# lights = []\n# bullets = []\n\n# def clear_dead_enemies_and_bullets():\n# global enemies, bullets\n# enemies = [e for e in enemies if e._deleted != True]\n# bullets = [b for b in bullets if b._deleted != True]\n\n# def update():\n# global _timer\n# _timer = _timer+1\n# fighter._last_shot_at-=1\n \n# game.print(int(_time.time()-START_AT), 600, 20, \"white\", 18)\n# if (fighter.damage_countdown\u003e0):\n# fighter.costumeId = int(_timer/4)%2+1\n# fighter.damage_countdown-=1\n# else:\n# fighter.costumeId = int(_timer/6)%2\n \n# if (_timer%20==0):\n# clear_dead_enemies_and_bullets()\n \n# if (_timer%20==0):\n# e = game.createSprite([\"enemy_1.png\",\"enemy_2.png\"])\n# e.rotationStyle = \"fixed\"\n# e.scale = 0.6\n# e.x = random.randint(0,640)\n# e.y = -20\n# e.toward(fighter)\n# enemies.append(e)\n# if (_timer%10==0):\n# l = game.createSprite(\"star_light.png\")\n# l.x = random.randint(0,640)\n# l.y = -20\n# l.layer = 0\n# l.scale = 0.2+random.random()*0.4\n# lights.append(l)\n# for e in enemies:\n# e.stepForward(4)\n# e.costumeId = int(_timer/6)%2\n# if e._deleted==False:\n# if(e.y\u003e660):\n# e.destroy()\n# if e.touched(fighter):\n# e.destroy()\n# fighter.life-=1\n# if(fighter.life\u003c=0):\n# fighter_explode()\n# game.sound.play('fighter_explode.wav')\n# else:\n# fighter.damage_countdown=30\n# game.sound.play('damage.wav')\n \n# for l in lights:\n# if l._deleted==False:\n# l.y += 18\n# if(l.y\u003e660):\n# l.destroy()\n# for b in bullets:\n# if b._deleted:\n# continue\n# b.stepForward(20)\n# if (b.y\u003c0 or b.y\u003e480 or b.x\u003e640 or b.x\u003c0):\n# b.destroy()\n# for b in bullets:\n# for e in enemies:\n# if b.touched(e):\n# game.sound.play('enemy_destroy.wav')\n# e.destroy()\n# b.destroy()\n \n# def fighter_shoot( angle=0 ):\n# if _timer==fighter._last_shot_at or _timer\u003e=fighter._last_shot_at+12 :\n# game.sound.play('laser.wav')\n# fighter._last_shot_at = _timer\n# bullet = game.createSprite(\"bullet.png\")\n# bullet.x = fighter.x\n# bullet.y = fighter.y\n# bullet.direction = angle\n# bullets.append(bullet)\n\n# def fighter_explode():\n# _explode_at = _time.time()\n# fighter.destroy()\n# sparks = []\n# for i in range(18):\n# s = game.createSprite(\"spark.png\")\n# s.scale = 0.4\n# s.r = 0\n# s.x = fighter.x\n# s.y = fighter.y\n# s.direction = i*20\n# sparks.append(s)\n# def sparks_expand():\n# for s in sparks:\n# s.stepForward(2)\n# s.scale = 0.4 * (1 + 0.5*math.sin(s.r))\n# s.r+=0.8\n# s.opacity -= 0.02\n# if s.opacity\u003c=0:\n# game.stop() \n# game.print(\"你存活了 \"+str(int(_explode_at-START_AT))+\" 秒\", 200, 200, \"white\", 40)\n# return\n# game.forever(sparks_expand)\n# game.forever(update)\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":315,"hashid":"yeys5qzm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":842140,"file_name":"Arcade-Fantasy.mp3","project_id":47196,"asset_id":88343,"created_at":"2018-11-01T13:29:43.409+08:00","updated_at":"2018-11-01T13:29:43.409+08:00"},{"id":842141,"file_name":"lootbox.png","project_id":47196,"asset_id":88352,"created_at":"2018-11-01T13:29:43.411+08:00","updated_at":"2018-11-01T13:29:43.411+08:00"},{"id":842142,"file_name":"star_light.png","project_id":47196,"asset_id":88358,"created_at":"2018-11-01T13:29:43.414+08:00","updated_at":"2018-11-01T13:29:43.414+08:00"},{"id":842143,"file_name":"laser.png","project_id":47196,"asset_id":88369,"created_at":"2018-11-01T13:29:43.416+08:00","updated_at":"2018-11-01T13:29:43.416+08:00"},{"id":842144,"file_name":"spark.png","project_id":47196,"asset_id":92350,"created_at":"2018-11-01T13:29:43.418+08:00","updated_at":"2018-11-01T13:29:43.418+08:00"},{"id":842145,"file_name":"fighter_1.png","project_id":47196,"asset_id":92351,"created_at":"2018-11-01T13:29:43.420+08:00","updated_at":"2018-11-01T13:29:43.420+08:00"},{"id":842146,"file_name":"fighter_2.png","project_id":47196,"asset_id":92352,"created_at":"2018-11-01T13:29:43.422+08:00","updated_at":"2018-11-01T13:29:43.422+08:00"},{"id":842147,"file_name":"bg.jpg","project_id":47196,"asset_id":92353,"created_at":"2018-11-01T13:29:43.424+08:00","updated_at":"2018-11-01T13:29:43.424+08:00"},{"id":842148,"file_name":"bullet.png","project_id":47196,"asset_id":92357,"created_at":"2018-11-01T13:29:43.426+08:00","updated_at":"2018-11-01T13:29:43.426+08:00"},{"id":842149,"file_name":"enemy_2.png","project_id":47196,"asset_id":92399,"created_at":"2018-11-01T13:29:43.427+08:00","updated_at":"2018-11-01T13:29:43.427+08:00"},{"id":842150,"file_name":"enemy_1.png","project_id":47196,"asset_id":92400,"created_at":"2018-11-01T13:29:43.429+08:00","updated_at":"2018-11-01T13:29:43.429+08:00"},{"id":842151,"file_name":"laser.wav","project_id":47196,"asset_id":92401,"created_at":"2018-11-01T13:29:43.431+08:00","updated_at":"2018-11-01T13:29:43.431+08:00"},{"id":842152,"file_name":"damage.wav","project_id":47196,"asset_id":92402,"created_at":"2018-11-01T13:29:43.434+08:00","updated_at":"2018-11-01T13:29:43.434+08:00"},{"id":842153,"file_name":"enemy_destroy.wav","project_id":47196,"asset_id":92403,"created_at":"2018-11-01T13:29:43.436+08:00","updated_at":"2018-11-01T13:29:43.436+08:00"},{"id":842154,"file_name":"fighter_explode.wav","project_id":47196,"asset_id":92404,"created_at":"2018-11-01T13:29:43.439+08:00","updated_at":"2018-11-01T13:29:43.439+08:00"},{"id":842155,"file_name":"fighter_damaged.png","project_id":47196,"asset_id":92406,"created_at":"2018-11-01T13:29:43.441+08:00","updated_at":"2018-11-01T13:29:43.441+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦