{"id":5723,"student_id":888,"content":"setBackdrop(\"sky.jpg\");\nvar cat = createSprite(\"cat.png\");\ncat.x=320;\ncat.y=420;\ncat.health = 25;\ncat.shiver = function(){\n var count = 10;\n\tvar interval = setInterval(function(){\n if(count%2==0){\n \tcat.x-=2; \n } else {\n \tcat.x+=2; \n }\n count--;\n \tif(count\u003c=0){\n clearInterval(interval);\n \t\tcat.shivering = false;\n }\n },50);\n cat.shivering = true;\n};\ncat.die = function(){\n cat.dead=true;\n var catSoul = createSprite(\"cat.png\");\n catSoul.x=cat.x;\n catSoul.y=cat.y;\n catSoul.opacity = 0.5;\n catSoul.forever(function(){\n this.y-=1;\n });\n};\nsetInterval(function(){\n\tvar snow = createSprite(\"snow.png\");\n snow.x = Math.random()*640;\n snow.y = -20;\n snow.v = 0.3+Math.random()*0.3;\n snow.direction = 180;\n snow.opacity = 0.5+Math.random()*0.5;\n snow.scale = 0.1+Math.random()*0.4;\n snow.forever(function(){\n if(this.touchedCat){\n \n } else if(this.touched(cat)){\n cat.health-=1;\n this.y+=3;\n if(cat.health==0){\n cat.die();\n } else if(!cat.dead \u0026\u0026 !cat.shivering){\n \tcat.shiver();\n }\n \tthis.touchedCat=true;\n } else if(this.y\u003e500){\n \tthis.destroy(); \n } else {\n if (this.distanceTo(cursor)\u003c40){\n this.toward(cursor); \n this.direction-=180; \n this.v = (45-this.distanceTo(cursor))/4;\n }\n if(this.direction\u003e180){\n this.direction-=1;\n } else if (this.direction\u003c180){\n this.direction+=1;\n }\n if(this.v\u003e0.6){this.v-=0.01;}\n \tthis.stepForward(this.v); \n }\n });\n},50);\n","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-02T00:31:42.973+08:00","name":"保護街貓","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/5723/35373e1a8d2c48367dc82fcbb5d4500e.jpg"},"parent_id":2,"plugin":"","description":"用滑鼠將落雪趕走,別讓雪掉到貓貓的身上。\n如果掉了太多貓貓會冷死哦~","note":null,"status":"public","like_student_ids":[1934,1935,273,172],"is_featured":true,"views":1851,"hashid":"gk4sr62","is_content_changed":null,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":140031,"file_name":"snow.png","project_id":5723,"asset_id":16805,"created_at":"2017-05-27T10:03:32.499+08:00","updated_at":"2017-05-27T10:03:32.499+08:00"},{"id":140032,"file_name":"sky.jpg","project_id":5723,"asset_id":16806,"created_at":"2017-05-27T10:03:32.502+08:00","updated_at":"2017-05-27T10:03:32.502+08:00"},{"id":140033,"file_name":"cat.png","project_id":5723,"asset_id":16807,"created_at":"2017-05-27T10:03:32.505+08:00","updated_at":"2017-05-27T10:03:32.505+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦