Class: Brick

Inherits:
GameObject show all
Defined in:
lib/entities/brick.rb

Overview

class Brick

Instance Attribute Summary

Attributes inherited from GameObject

#collider, #x, #y

Instance Method Summary collapse

Methods inherited from GameObject

#collide?, #collision_detect, #done?, #draw, #solid?

Constructor Details

#initialize(x, y) ⇒ Brick

Returns a new instance of Brick.



5
6
7
8
# File 'lib/entities/brick.rb', line 5

def initialize(x, y)
  super(x, y, 2, 2, true)
  @sprite = Sprite.new(:brickwall, false)
end

Instance Method Details

#hitted(_obj) ⇒ Object



10
11
12
# File 'lib/entities/brick.rb', line 10

def hitted(_obj)
  @done = true
end

#updateObject



14
15
16
# File 'lib/entities/brick.rb', line 14

def update
  @sprite.update
end