Last active
April 12, 2019 17:36
-
-
Save wastu01/5a25807b40a49f90cdb09e4be440ff6d to your computer and use it in GitHub Desktop.
按鈕競賽遊戲
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var button; | |
/*宣告按鈕*/ | |
boardReady({board 'Smart', url: '172.20.10.6'}, function (board) { | |
/*smart 用websucket 連線*/ | |
board.systemReset(); | |
board.samplingInterval = 50; | |
button = getButton(board, 4); | |
/*上拉按鈕開關=4*/ | |
var btnGameNpcShow_ = document.getElementById("npcshow"), | |
/*略(1)*/ | |
btnGameUserSpeed_; | |
/*設定相關變數 可以自行設定*/ | |
btnGameStart_.className = ""; | |
btnGameNpcImg_.setAttribute("src","https://thumbs.gfycat.com/MiserlyFocusedBeardeddragon.webp"); | |
btnGameUserImg_.setAttribute("src","http://webduinoio.github.io/webduino-blockly/media/tutorials/run-man2.gif"); | |
/*換圖片*/ | |
btnGameGoal_.innerHTML = btnGameDistance_; | |
btnGameStart_.addEventListener("click",go); | |
/*按開始執行函數*/ | |
function go(){ | |
btnGameStart_.className = "go"; | |
btnGameA_ = 0; | |
btnGameB_ = 0; | |
/*略(2)*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment