Class: GamesAndRpgParadise::Tetris::ShapeT

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

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) ⇒ ShapeT

#

initialize

#


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

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

Instance Method Details

#get_blocksObject

#

get_blocks

#


29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/games_and_rpg_paradise/gui/gosu/tetris/shape_t.rb', line 29

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