Class: RoadToRubykaigi::Sprite::Bonus

Inherits:
RoadToRubykaigi::Sprite show all
Defined in:
lib/road_to_rubykaigi/sprite/bonus.rb

Constant Summary collapse

CHARACTER =
{
  ruby: "💎",
  money: "💰",
  coffee: "☕️",
  book: "📚",
  sushi: "🍣",
  meat: "🍖",
  fish: "🐟",
  beer: "🍺",
  sake: "🍶",
  laptop: "💻",
}
TYPE =
{
  ruby: :basic,
  money: :basic,
  coffee: :basic,
  book: :basic,
  sushi: :basic,
  meat: :basic,
  fish: :basic,
  beer: :alcohol,
  sake: :alcohol,
  laptop: :laptop,
}

Instance Method Summary collapse

Instance Method Details

#bounding_boxObject



118
119
120
# File 'lib/road_to_rubykaigi/sprite/bonus.rb', line 118

def bounding_box
  { x: @x, y: @y, width: width, height: height }
end

#charactersObject



122
123
124
# File 'lib/road_to_rubykaigi/sprite/bonus.rb', line 122

def characters
  super { [CHARACTER[@character]] }
end

#heightObject



130
131
132
# File 'lib/road_to_rubykaigi/sprite/bonus.rb', line 130

def height
  1
end

#typeObject



114
115
116
# File 'lib/road_to_rubykaigi/sprite/bonus.rb', line 114

def type
  TYPE[@character]
end

#widthObject



126
127
128
# File 'lib/road_to_rubykaigi/sprite/bonus.rb', line 126

def width
  2
end