Class: Stone

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

Overview

class Stone

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

Returns a new instance of Stone.



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

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

Instance Method Details

#hitted(obj) ⇒ Object



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

def hitted(obj)
  @done = true if obj.powerful == true
end

#updateObject



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

def update
  @sprite.update
end