Class: GamesAndRpgParadise::Tetris::ShapeS

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

Instance Attribute Summary

Attributes inherited from Shape

#rotation

Instance Method Summary collapse

Methods inherited from ShapeZ

#initialize, #reset

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::ShapeZ

Instance Method Details

#get_blocksObject

#

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.

#


26
27
28
29
30
31
32
33
34
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_s.rb', line 26

def get_blocks
  old_rotation = @rotation
  @rotation = 0
  super
  reverse
  @rotation = old_rotation
  apply_rotation
  @blocks.each { |block| block.color = 0xff00ff00}
end