lib/fantasy/global.rb in fantasy-0.1.5 vs lib/fantasy/global.rb in fantasy-0.1.5.1
- old
+ new
@@ -33,11 +33,11 @@
@pixel_font = Gosu::Font.new(20, { name: "#{__dir__}/../../fonts/VT323-Regular.ttf" } )
@d_key_pressed = false
@references = OpenStruct.new
@camera = Camera.new(position: Coordinates.zero)
@game_state = Global.presentation_proc.nil? ? "game" : "presentation"
- @game_started_at = Time.now
+ @scene_started_at = Time.now
if @presentation_proc.nil?
on_presentation { Global.default_on_presentation }
end
@@ -100,10 +100,11 @@
clear_state_elements
end_proc.call
end
def clear_state_elements
+ @scene_started_at = Time.now
@actors.clear
@hud_texts.clear
@hud_images.clear
@backgrounds.clear
@tile_maps.clear
@@ -118,10 +119,10 @@
def setup
Sound.preload_sounds
Image.preload_images
end
- def seconds_in_game
- Time.now - @game_started_at
+ def seconds_in_scene
+ Time.now - @scene_started_at
end
end
end