{"id":449540,"student_id":10,"content":"target = createSprite('target_0.png', 'target_1.png') //創造目標\ntarget.x = 1100 //設定目標水平位置\ntarget.y = 300 //設定目標垂直位置\n\nball = createSprite('b.png') //創造籃球\nball.x = 100 //設定籃球水平位置\nball.y = 600 //設定籃球垂直位置\n\nstart = false //是否移動\nvx = 10 //水平速度\nvy = -10 //垂直速度\n\n//遊戲迴圈\nfunction gameloop() {\n if (ball.touched(target)) { //如果碰到目標\n target.costume_id = 1 //切換綠色造型\n }\n \n if (start) { //如果開始移動\n ball.x = ball.x + vx //根據水平速度移動\n ball.y = ball.y + vy //根據垂直速度移動\n vy = vy + 0.02 //引力\n }\n}\n\n//畫面點擊\nfunction click() {\n start = true //開始移動\n vx = (cursor.x - ball.x) / 100 //計算起始水平速度\n vy = (cursor.y - ball.y) / 100 //計算起始垂直速度\n}\n\nforever(gameloop) //不斷執行遊戲迴圈\non('click', click) //點擊畫面觸發 click 程式","created_at":"2022-10-18T18:54:07.640+08:00","updated_at":"2022-10-18T19:46:36.778+08:00","name":"投籃","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/449540/84e61930be6f52af043c0644914e6562.jpg"},"parent_id":2,"plugin":"Game.set({ width: 1200, height: 900 })","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":127,"hashid":"p93s4zvm6","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10167550,"file_name":"b.png","project_id":449540,"asset_id":574227,"created_at":"2022-10-18T18:56:07.207+08:00","updated_at":"2022-10-18T18:56:21.057+08:00"},{"id":10167548,"file_name":"target_1.png","project_id":449540,"asset_id":574232,"created_at":"2022-10-18T18:55:34.563+08:00","updated_at":"2022-10-18T18:55:34.563+08:00"},{"id":10167549,"file_name":"target_0.png","project_id":449540,"asset_id":574233,"created_at":"2022-10-18T18:55:34.565+08:00","updated_at":"2022-10-18T18:55:34.565+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦