Class: GamesAndRpgParadise::Tetris::ShapeJ

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

Instance Attribute Summary

Attributes inherited from Shape

#rotation

Instance Method Summary collapse

Methods inherited from ShapeL

#initialize

Methods inherited from Shape

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

Constructor Details

This class inherits a constructor from GamesAndRpgParadise::Tetris::ShapeL

Instance Method Details

#get_blocksObject

#

get_blocks

#


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_j.rb', line 20

def get_blocks
  # ======================================================================= #
  # Reverse will reverse also the direction of rotation 
  # that's applied in apply_rotation.
  # This will temporary disable rotation in the super method, so we can
  # handle the rotation here after the reverse.
  # ======================================================================= #
  old_rotation = @rotation
  @rotation = 0
  super
  reverse
  @rotation = old_rotation
  apply_rotation
  @blocks.each { |block|
    block.color = 0xff0000ff
  }
end