{"id":228862,"student_id":10,"content":"let sprites = [];\nlet clock = 0;\nlet speed = 4;\nlet animals = [];\n\nfor (let x = 0; x \u003c 10; x++) {\n for (let y = 0; y \u003c 15; y++) {\n let b = createSprite(\"1.png\", \"3.png\", \"4.png\", \"5.png\", \"6.png\");\n b.x = x * 100 + 50;\n b.y = y * 100 + 50;\n sprites.push(b);\n }\n}\n\nfor (let y=0; y\u003c8; y++) {\n let a = createSprite(\"5.png\");\n a.y = -1000 + y * 100 + 50;\n animals.push(a);\n}\n\n\nlet player = createSprite(\"2.png\");\nplayer.x = 550;\nplayer.y = 550;\n\nfunction gameloop () {\n clock++;\n player.y += speed;\n\n for (let i = 0; i \u003c sprites.length; i++) {\n let s = sprites[i];\n s.y += speed;\n if (s.y \u003e 1500) {\n s.y -= 1500;\n let rand = Math.random();\n if (clock % 3000 \u003c 200) {\n if (s.x \u003e 150 \u0026\u0026 s.x \u003c 850) {\n s.costumeId = 4;\n } else {\n s.costumeId = 0;\n }\n } else {\n if (rand \u003c 0.1) {\n s.costumeId = 1;\n } else if (rand \u003c 0.2) {\n s.costumeId = 2;\n } else {\n s.costumeId = 4;\n }\n }\n }\n if (s.touched(player)) {\n if (s.costumeId == 1) {\n s.costumeId = 4;\n }\n if (s.costumeId == 2) {\n player.y += 100;\n }\n }\n }\n \n for (let i=0; i\u003canimals.length; i++) {\n let a = animals[i];\n a.x += 5;\n a.y += speed;\n if (a.x \u003e 1000) a.x -= 1000 + Math.random() * 200;\n if (a.y \u003e 1500) a.y -= 2000;\n }\n}\n\nfunction jumpRight () {\n player.y -= 100;\n player.x += 100;\n}\n\nfunction jumpLeft () {\n player.y -= 100;\n player.x -= 100;\n}\n\non('keydown', 'right', jumpRight);\non('keydown', 'left', jumpLeft);\nforever(gameloop);","created_at":"2021-02-10T20:51:04.297+08:00","updated_at":"2021-03-23T14:20:41.522+08:00","name":"test","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/228862/8176639750088f08c09737789b26a9c3.jpg"},"parent_id":2,"plugin":"Game.set({ width: 1000, height: 1500 })","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":368,"hashid":"npms34vmw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4091237,"file_name":"5.png","project_id":228862,"asset_id":317330,"created_at":"2021-02-10T20:51:19.908+08:00","updated_at":"2021-02-10T20:51:19.908+08:00"},{"id":4091238,"file_name":"6.png","project_id":228862,"asset_id":317331,"created_at":"2021-02-10T20:51:19.910+08:00","updated_at":"2021-02-10T20:51:19.910+08:00"},{"id":4091233,"file_name":"1.png","project_id":228862,"asset_id":317326,"created_at":"2021-02-10T20:51:19.279+08:00","updated_at":"2021-02-10T20:51:19.279+08:00"},{"id":4091234,"file_name":"2.png","project_id":228862,"asset_id":317327,"created_at":"2021-02-10T20:51:19.281+08:00","updated_at":"2021-02-10T20:51:19.281+08:00"},{"id":4091235,"file_name":"3.png","project_id":228862,"asset_id":317328,"created_at":"2021-02-10T20:51:19.576+08:00","updated_at":"2021-02-10T20:51:19.576+08:00"},{"id":4091236,"file_name":"4.png","project_id":228862,"asset_id":317329,"created_at":"2021-02-10T20:51:19.577+08:00","updated_at":"2021-02-10T20:51:19.577+08:00"}]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer