Class: Background
- Inherits:
-
Actor
- Object
- Actor
- Background
- Defined in:
- lib/missile-command-ruby.rb
Instance Attribute Summary collapse
-
#x1 ⇒ Object
Returns the value of attribute x1.
-
#x2 ⇒ Object
Returns the value of attribute x2.
-
#x3 ⇒ Object
Returns the value of attribute x3.
-
#x4 ⇒ Object
Returns the value of attribute x4.
-
#y1 ⇒ Object
Returns the value of attribute y1.
-
#y2 ⇒ Object
Returns the value of attribute y2.
-
#y3 ⇒ Object
Returns the value of attribute y3.
-
#y4 ⇒ Object
Returns the value of attribute y4.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(opts) ⇒ Background
constructor
A new instance of Background.
Constructor Details
#initialize(opts) ⇒ Background
Returns a new instance of Background.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/missile-command-ruby.rb', line 29 def initialize opts super @z = ZOrder::Background @y1 = opts[:init_y] || 0 @y2 = opts[:init_y] || 0 @y3 = opts[:end_y] || $lotu.height @y4 = opts[:end_y] || $lotu.height @x1 = opts[:init_x] || 0 @x2 = opts[:end_x] || $lotu.width @x3 = opts[:end_x] || $lotu.width @x4 = opts[:init_x] || 0 @c1 = opts[:init_color] || 0xff000000 @c2 = opts[:init_color] || 0xff000000 @c3 = opts[:end_color] || 0xff000000 @c4 = opts[:end_color] || 0xff000000 interpolate_my :y1, :init => @y1, :end => 700, :duration => 50, :loop => true, :bounce => true interpolate_my :y2, :init => @y2, :end => 700, :duration => 50, :loop => true, :bounce => true end |
Instance Attribute Details
#x1 ⇒ Object
Returns the value of attribute x1.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def x1 @x1 end |
#x2 ⇒ Object
Returns the value of attribute x2.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def x2 @x2 end |
#x3 ⇒ Object
Returns the value of attribute x3.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def x3 @x3 end |
#x4 ⇒ Object
Returns the value of attribute x4.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def x4 @x4 end |
#y1 ⇒ Object
Returns the value of attribute y1.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def y1 @y1 end |
#y2 ⇒ Object
Returns the value of attribute y2.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def y2 @y2 end |
#y3 ⇒ Object
Returns the value of attribute y3.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def y3 @y3 end |
#y4 ⇒ Object
Returns the value of attribute y4.
27 28 29 |
# File 'lib/missile-command-ruby.rb', line 27 def y4 @y4 end |
Instance Method Details
#draw ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/missile-command-ruby.rb', line 52 def draw super $lotu.draw_quad( @x1, @y1, @c1, @x2, @y2, @c2, @x3, @y3, @c3, @x4, @y4, @c4, ZOrder::Background, @mode) end |