Class: GamesAndRpgParadise::Tetris::ShapeZ

Inherits:
Shape
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/gui/gosu/tetris/shape_z.rb

Direct Known Subclasses

ShapeS

Instance Attribute Summary

Attributes inherited from Shape

#rotation

Instance Method Summary collapse

Methods inherited from Shape

#apply_rotation, #collide, #draw, #get_bounds, #needs_fall_update?, #needs_move_update?, #reset_internal_variables, #reverse, #update

Constructor Details

#initialize(game) ⇒ ShapeZ

#

initialize

#


20
21
22
23
24
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_z.rb', line 20

def initialize(game)
  super(game)
  @rotation_block = @blocks[1]
  reset
end

Instance Method Details

#get_blocksObject

#

get_blocks

#


36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_z.rb', line 36

def get_blocks
  @blocks[0].x = @x
  @blocks[1].x = @x + @game.block_width
  @blocks[2].x = @x + @game.block_width
  @blocks[3].x = @x + @game.block_width*2
  @blocks[0].y = @y
  @blocks[1].y = @y
  @blocks[2].y = @y + @game.block_height
  @blocks[3].y = @y + @game.block_height
  apply_rotation
  @blocks.each { |block| block.color = 0xffff0000}
end

#resetObject

#

reset

#


29
30
31
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_z.rb', line 29

def reset
  @rotation_cycle = 2
end