rm push/pop
This commit is contained in:
@@ -50,16 +50,16 @@ function init_board() {
|
||||
row = []
|
||||
srow = []
|
||||
for (c = 0; c < COLS; c++) {
|
||||
push(row, null)
|
||||
push(srow, shape.rect({
|
||||
row[] = null
|
||||
srow[] = shape.rect({
|
||||
pos: {x: c * TILE + TILE / 2, y: r * TILE + TILE / 2},
|
||||
width: TILE - 1, height: TILE - 1,
|
||||
fill: {r: 0.5, g: 0.5, b: 0.5, a: 1},
|
||||
plane: 'game', layer: 0, visible: false
|
||||
}))
|
||||
})
|
||||
}
|
||||
push(board, row)
|
||||
push(board_shapes, srow)
|
||||
board[] = row
|
||||
board_shapes[] = srow
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,10 +104,10 @@ var next_label = text2d({
|
||||
var next_shapes = []
|
||||
var ns = 0
|
||||
for (ns = 0; ns < 4; ns++) {
|
||||
push(next_shapes, shape.rect({
|
||||
next_shapes[] = shape.rect({
|
||||
pos: {x: 0, y: 0}, width: TILE - 1, height: TILE - 1,
|
||||
fill: {r: 1, g: 1, b: 1, a: 1}, plane: 'game', layer: 2, visible: false
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
function random_shape() {
|
||||
@@ -244,10 +244,10 @@ function place_piece() {
|
||||
// Create 4 shapes for active piece (layer 1 = on top of board)
|
||||
var pi = 0
|
||||
for (pi = 0; pi < 4; pi++) {
|
||||
push(piece_shapes, shape.rect({
|
||||
piece_shapes[] = shape.rect({
|
||||
pos: {x: 0, y: 0}, width: TILE - 1, height: TILE - 1,
|
||||
fill: {r: 1, g: 1, b: 1, a: 1}, plane: 'game', layer: 1, visible: false
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
init_board()
|
||||
|
||||
Reference in New Issue
Block a user