Class: Core::Game::Bubble
- Inherits:
-
Core::GUI::Textfield
- Object
- Core::GUI::Element
- Core::GUI::Textfield
- Core::Game::Bubble
- Defined in:
- lib/game/npc/bubble.rb
Instance Attribute Summary
Attributes inherited from Core::GUI::Textfield
Attributes inherited from Core::GUI::Element
#h, #w, #x, #xoff, #y, #yoff, #zoff
Instance Method Summary collapse
- #draw(x, y) ⇒ Object
-
#initialize(text) ⇒ Bubble
constructor
A new instance of Bubble.
- #update ⇒ Object
Methods inherited from Core::GUI::Textfield
Methods inherited from Core::GUI::Element
Constructor Details
Instance Method Details
#draw(x, y) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/game/npc/bubble.rb', line 19 def draw(x, y) @x, @y = x-(@w/2)+16, y-40-@h super() c = Gosu::Color::GREEN Core.window.draw_triangle(@x+(@w/2)-4, @y+@h, c, @x+(@w/2)+4, @y+@h, c, @x+(@w/2), @y+@h+24, c, Core::MAPOBJECT_Z+100) end |
#update ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/game/npc/bubble.rb', line 11 def update if @age <= 0 @remove = true else @age -= 1 end end |