Sha256: 8b1fb249e7b3e0ebc515dff543158801ae47d42485645a944815c0658049c5b2

Contents?: true

Size: 440 Bytes

Versions: 3

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module Engine::Components
  class PointLight < Engine::Component
    attr_accessor :range, :colour

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

    def start
      PointLight.point_lights << self
    end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_rpg-0.0.4 lib/engine/components/point_light.rb
ruby_rpg-0.0.3 lib/engine/components/point_light.rb
ruby_rpg-0.0.2 lib/engine/components/point_light.rb