Web hosting e commerce - 494 . Chapter 23 // a shape is
494 . Chapter 23 // a shape is currently falling so move it one square downwards moveY() // call after speed milliseconds timerID = setTimeout(’play()’, speed) } // constructs an object representing a specific position function characteristics(x, y) { // create property to hold status (block or empty) this.state = state(x, y) // if block found in specified position if (state(x, y)) { // local variable to hold URL of image at specified location var src = document.images[computeIndex(x, y)].src // local variable to hold color (0, 1, 2, …, 6) var color = src.charAt(src.lastIndexOf(’/') + 2) } else // no color because no block found at specified position color = 1 // convert color from string to integer and assign to property this.color = parseInt(color) // create property to hold square’s current state (active or not, 1 or 0) this.activity = ar[x][y] } // contructs a map of entire board and status function fullMap() { for (varx=0;x<10; ++x) { this[x] = new Array(10) for (vary=0;y<19; ++y) { this[x][y] = new characteristics(x, y) } } this.shape = shape } // pause and unpause game function pause() { // if game is not paused if (!paused) { // stop timer clearTimeout(timerID) // game is now paused paused = true // create global map of board map = new fullMap() // flood board so player cannot see current status flood(1)
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.