Class: Engine::Components::PointLight

Inherits:
Engine::Component show all
Defined in:
lib/engine/components/point_light.rb

Instance Attribute Summary collapse

Attributes inherited from Engine::Component

#game_object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Engine::Component

#_erase!, #destroy, #destroyed?, destroyed_components, erase_destroyed_components, method_added, #renderer?, #set_game_object, #ui_renderer?, #update

Constructor Details

#initialize(range: 300, colour: [1.0, 1.0, 1.0]) ⇒ PointLight

Returns a new instance of PointLight.



7
8
9
10
# File 'lib/engine/components/point_light.rb', line 7

def initialize(range: 300, colour: [1.0, 1.0, 1.0])
  @range = range
  @colour = colour
end

Instance Attribute Details

#colourObject

Returns the value of attribute colour.



5
6
7
# File 'lib/engine/components/point_light.rb', line 5

def colour
  @colour
end

#rangeObject

Returns the value of attribute range.



5
6
7
# File 'lib/engine/components/point_light.rb', line 5

def range
  @range
end

Class Method Details

.point_lightsObject



20
21
22
# File 'lib/engine/components/point_light.rb', line 20

def self.point_lights
  @point_lights ||= []
end

Instance Method Details

#destroy!Object



16
17
18
# File 'lib/engine/components/point_light.rb', line 16

def destroy!
  PointLight.point_lights.delete(self)
end

#startObject



12
13
14
# File 'lib/engine/components/point_light.rb', line 12

def start
  PointLight.point_lights << self
end