mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Fixed demo feature crashing game
This commit is contained in:
@@ -130,7 +130,6 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def turn_left
|
def turn_left
|
||||||
puts "CALLED"
|
|
||||||
@orientation.y += @turn_speed * delta_time
|
@orientation.y += @turn_speed * delta_time
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ class IMICFPS
|
|||||||
@demo_index= 0
|
@demo_index= 0
|
||||||
@demo_changed = false
|
@demo_changed = false
|
||||||
|
|
||||||
@demo_last_pitch = @camera.pitch
|
@demo_last_pitch = @camera.orientation.z
|
||||||
@demo_last_yaw = @camera.yaw
|
@demo_last_yaw = @camera.orientation.y
|
||||||
|
|
||||||
at_exit { @demo_file.close }
|
at_exit { @demo_file.close }
|
||||||
end
|
end
|
||||||
@@ -138,15 +138,15 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ARGV.join.include?("--savedemo")
|
if ARGV.join.include?("--savedemo")
|
||||||
if @camera.pitch != @demo_last_pitch || @camera.yaw != @demo_last_yaw
|
if @camera.orientation.z != @demo_last_pitch || @camera.orientation.y != @demo_last_yaw
|
||||||
unless @demo_last_written_index == @demo_index
|
unless @demo_last_written_index == @demo_index
|
||||||
@demo_last_written_index = @demo_index
|
@demo_last_written_index = @demo_index
|
||||||
@demo_file.puts("tick #{@demo_index}")
|
@demo_file.puts("tick #{@demo_index}")
|
||||||
end
|
end
|
||||||
|
|
||||||
@demo_file.puts("mouse #{@camera.z} #{@camera.y}")
|
@demo_file.puts("mouse #{@camera.orientation.z} #{@camera.orientation.y}")
|
||||||
@demo_last_pitch = @camera.z
|
@demo_last_pitch = @camera.orientation.z
|
||||||
@demo_last_yaw = @camera.y
|
@demo_last_yaw = @camera.orientation.y
|
||||||
end
|
end
|
||||||
|
|
||||||
@demo_changed = false
|
@demo_changed = false
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class IMICFPS
|
|||||||
|
|
||||||
title "I-MIC FPS"
|
title "I-MIC FPS"
|
||||||
@subheading = Text.new("Loading Map: #{@map.metadata.name}", y: 100, size: 50, alignment: :center)
|
@subheading = Text.new("Loading Map: #{@map.metadata.name}", y: 100, size: 50, alignment: :center)
|
||||||
|
@description = Text.new("Map created by: #{@map.metadata.authors.join(", ")}\n#{@map.metadata.description}", y: 180, size: 24, alignment: :center)
|
||||||
@state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center)
|
@state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center)
|
||||||
@percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center)
|
@percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center)
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ class IMICFPS
|
|||||||
def draw
|
def draw
|
||||||
super
|
super
|
||||||
@subheading.draw
|
@subheading.draw
|
||||||
|
@description.draw
|
||||||
@state.draw
|
@state.draw
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user