examples/pending/netris/src/grid.rb
# Adds a new playing piece to the field and
# returns [x,y] of where a new piece needs to be placed.
# This is an offset from this grid's location, and assumes
# the grid is drawn at 0,0. If different, make sure these values
# are modified properly
Adds a new playing piece to the field and
returns [x,y] of where a new piece needs to be placed.
This is an offset from this grid's location, and assumes
the grid is drawn at 0,0. If different, make sure these values
are modified properly
Adds a new playing piece to the field and returns [ x y ] of where a new piece needs to be placed . This is an offset from this grid ' s location and assumes the grid is drawn at 0 0 . If different make sure these values are modified properly
def new_piece
    next_tetromino
    col = @columns / 2 - 1
    row = 0
    @falling_piece.x = col * @block_size + self.screen_x
    @falling_piece.y = row * @block_size + self.screen_y
    @falling_piece.grid_position.x = col + 1
    @falling_piece.grid_position.y = row
    if collides?
      game_over
    end
  end
def new_piece next_tetromino col = @columns / 2 - 1 row = 0 @falling_piece . x = col * @block_size + self . screen_x @falling_piece . y = row * @block_size + self . screen_y @falling_piece . grid_position . x = col + 1 @falling_piece . grid_position . y = row if collides? game_over end end
Adds a new playing piece to the field and
returns [x,y] of where a new piece needs to be placed.
Adds a new playing piece to the field and returns [ x y ] of where a new piece needs to be placed .