Class: Smalruby::Stage
- Defined in:
- lib/smalruby/stage.rb
Overview
ステージを表現するクラス
Instance Attribute Summary
Attributes inherited from Character
#angle, #checking_hit_targets, #event_handlers, #threads
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Stage
constructor
A new instance of Stage.
Methods inherited from Canvas
#box, #box_fill, #circle, #circle_fill, #draw_font, #fill, #line
Methods inherited from Character
#alive?, #button, #button_down, #button_up, #click, #distance, #draw, #hit, #hit?, #join, #key_down, #key_push, #led, #loop, #move, #move_back, #on, #play, #point_towards, #reach_wall?, #rgb_led_anode, #rgb_led_cathode, #rotate, #say, #sensor, #sensor_change, #servo, #start, #turn, #turn_if_reach_wall, #two_wheel_drive_car
Constructor Details
#initialize(options = {}) ⇒ Stage
Returns a new instance of Stage.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/smalruby/stage.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 |