Class: GamesAndRpgParadise::Tetris::ShapeL
- Inherits:
-
Shape
- Object
- Shape
- GamesAndRpgParadise::Tetris::ShapeL
show all
- Defined in:
- lib/games_and_rpg_paradise/gui/gosu/tetris/shape_l.rb
Direct Known Subclasses
ShapeJ
Instance Attribute Summary
Attributes inherited from Shape
#rotation
Instance Method Summary
collapse
-
#get_blocks ⇒ Object
# === get_blocks ========================================================================= #.
-
#initialize(game) ⇒ ShapeL
constructor
# === initialize ========================================================================= #.
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) ⇒ ShapeL
20
21
22
23
24
|
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_l.rb', line 20
def initialize(game)
super(game)
@rotation_block = @blocks[1]
@rotation_cycle = 4
end
|
Instance Method Details
#get_blocks ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_l.rb', line 29
def get_blocks
@blocks[0].x = @x
@blocks[1].x = @x
@blocks[2].x = @x
@blocks[3].x = @x + @game.block_width
@blocks[0].y = @y
@blocks[1].y = @blocks[0].y + @game.block_height
@blocks[2].y = @blocks[1].y + @game.block_height
@blocks[3].y = @blocks[2].y
apply_rotation
@blocks.each { |block| block.color = 0xffff7f00 }
end
|