Class: Smalruby::Scene
- Defined in:
- lib/smalruby/scene.rb
Overview
シーンを表現するクラス
Instance Attribute Summary
Attributes inherited from Character
#checking_hit_targets, #event_handlers, #threads
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Scene
constructor
A new instance of Scene.
Methods inherited from Canvas
#box, #box_fill, #circle, #circle_fill, #draw_font, #fill, #line
Methods inherited from Character
#alive?, #click, #distance, #draw, #hit, #join, #key_down, #key_push, #led, #loop, #move, #move_back, #on, #play, #reach_wall?, #rgb_led_anode, #rgb_led_cathode, #rotate, #say, #sensor, #sensor_change, #start, #turn, #turn_if_reach_wall
Constructor Details
#initialize(options = {}) ⇒ Scene
Returns a new instance of Scene.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/smalruby/scene.rb', line 6 def initialize( = {}) defaults = { color: 'black' } opts = Util.(, defaults) super(opts.reject { |k, v| defaults.keys.include?(k) }) fill(color: opts[:color]) end |