class Tree

Attributes

graphics[R]
health[R]

Public Class Methods

new(object_pool, x, y, seed) click to toggle source
Calls superclass method GameObject::new
# File lib/entities/tree.rb, line 4
def initialize(object_pool, x, y, seed)
  super(object_pool, x, y)
  @graphics = TreeGraphics.new(self, seed)
  @health = Health.new(self, object_pool, 30, false)
  @angle = rand(-15..15)
end

Public Instance Methods

box() click to toggle source
# File lib/entities/tree.rb, line 15
def box
  [@x, @y]
end
on_collision(object) click to toggle source
# File lib/entities/tree.rb, line 11
def on_collision(object)
  @graphics.shake(object.direction)
end