{"id":193918,"student_id":12205,"content":"setBackdrop('bg.jpg');\n\nvar ball = createSprite(\"ball.png\");\nvar p1 = createSprite(\"orange.jpg\");\nvar p2 = createSprite(\"blue.jpg\");\np1.x = 631;\np2.x = 10;\n\nvar score1 = 0;\nvar score2 = 0;\nvar speed = 5;\nball.direction = 100;\nsound.play('wert.mp3');\n\nforever(function() {\n \n touchBorder();\n playContral();\n touchplayer();\n ball.stepForward(speed);\n print(score2, 30, 20, '#157df9', 40);\n print(score1, 580, 20, '#fd7e24', 40);\n});\nfunction touchBorder() {\n if (p1.y \u003c 0) {\n p1.y = 0;\n }\n if (p2.y \u003c 0) {\n p2.y = 0;\n }\n if (p2.y \u003e 425) {\n p2.y = 425;\n }\n if (p1.y \u003e 425) {\n p1.y = 425;\n }\n if (ball.x \u003c 0) {\n speed = 5;\n score1 += 1;\n ball.x = 320;\n ball.y = 240;\n ball.direction = Math.random()*-90+-45;\n }\n if (ball.x \u003e 640) {\n speed = 5;\n score2 += 1;\n ball.x = 320;\n ball.y = 240;\n ball.direction = Math.random()*90+45;\n }\n if (ball.y \u003c 0 || ball.y \u003e 480) {\n ball.direction = -ball.direction - 180;\n }\n}\nfunction playContral() {\n if (key.down) {\n p1.y += 10;\n }\n if (key.up) {\n p1.y -= 10;\n }\n if (key.w) {\n p2.y -= 10;\n }\n\n if (key.s) {\n p2.y += 10;\n }\n if(key.r){\n ball.x = 320;\n ball.y = 240;\n ball.direction = Math.random()*-90+-45; \n }\n if(score1 == 30 ){\n print(\"p1 win\", 180, 180, '#fd7e24', 100);\n stop();\n }\n if(score2 == 30 ){\n print(\"p2 win\", 180, 180, '#157df9', 100);\n stop();\n }\n\n}\nfunction touchplayer() {\n if (ball.touched(p1) || ball.touched(p2)) {\n sound.play('BonusCube.mp3');\n ball.direction = -ball.direction + Math.random()*16;\n speed = speed +0.5;\n }\n\n}","created_at":"2020-09-25T19:12:16.611+08:00","updated_at":"2024-06-04T11:06:53.923+08:00","name":"彈力球大賽 副本","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/193918/7b830c56f975bb235e66b0181c49bf4e.jpg"},"parent_id":8219,"plugin":"\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":203,"hashid":"36ys6vpj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3318654,"file_name":"blue.jpg","project_id":193918,"asset_id":22110,"created_at":"2020-09-25T19:12:16.639+08:00","updated_at":"2020-09-25T19:12:16.639+08:00"},{"id":3318655,"file_name":"orange.jpg","project_id":193918,"asset_id":22111,"created_at":"2020-09-25T19:12:16.641+08:00","updated_at":"2020-09-25T19:12:16.641+08:00"},{"id":3318656,"file_name":"ball.png","project_id":193918,"asset_id":22112,"created_at":"2020-09-25T19:12:16.645+08:00","updated_at":"2020-09-25T19:12:16.645+08:00"},{"id":3318657,"file_name":"bg.jpg","project_id":193918,"asset_id":22113,"created_at":"2020-09-25T19:12:16.649+08:00","updated_at":"2020-09-25T19:12:16.649+08:00"},{"id":3318658,"file_name":"BonusCube.mp3","project_id":193918,"asset_id":22114,"created_at":"2020-09-25T19:12:16.653+08:00","updated_at":"2020-09-25T19:12:16.653+08:00"},{"id":3319589,"file_name":"wert.mp3","project_id":193918,"asset_id":266596,"created_at":"2020-09-25T20:48:16.507+08:00","updated_at":"2020-09-25T20:48:16.507+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