Class: Doom::Game::SectorEffects
- Inherits:
-
Object
- Object
- Doom::Game::SectorEffects
- Defined in:
- lib/doom/game/sector_effects.rb
Overview
Sector light specials and scrolling walls, matching Chocolate Doom’s P_SpawnSpecials (p_spec.c) and p_lights.c.
Defined Under Namespace
Classes: FireFlicker, Glow, LightFlash, StrobeFlash
Constant Summary collapse
- GLOWSPEED =
Light units per tic for glow
8- STROBEBRIGHT =
Bright duration for strobes (tics)
5- FASTDARK =
Dark duration for fast strobe (tics)
15- SLOWDARK =
Dark duration for slow strobe (tics)
35
Instance Method Summary collapse
-
#initialize(map) ⇒ SectorEffects
constructor
A new instance of SectorEffects.
-
#update ⇒ Object
Called every game tic (35/sec).
Constructor Details
#initialize(map) ⇒ SectorEffects
13 14 15 16 17 18 |
# File 'lib/doom/game/sector_effects.rb', line 13 def initialize(map) @map = map @effects = [] @scroll_sides = [] spawn_specials end |
Instance Method Details
#update ⇒ Object
Called every game tic (35/sec)
21 22 23 24 |
# File 'lib/doom/game/sector_effects.rb', line 21 def update @effects.each(&:update) @scroll_sides.each { |side| side.x_offset += 1 } end |