Added them lights, relative speed!

This commit is contained in:
2018-03-19 08:54:06 -05:00
parent 4818d5a67e
commit 6df9f09496
2 changed files with 64 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ class IMICFPS
super(window_width, window_height, fullscreen)
# super(Gosu.screen_width, Gosu.screen_height, true)
$window = self
@delta_time = Gosu.milliseconds
@number_of_faces = 0
@draw_skydome = true
@skydome = Wavefront::Model.new("objects/skydome.obj")
@@ -117,7 +118,7 @@ class IMICFPS
@camera_light.postion = @light_postion
# @light_postion = [0.0, 10, 0, 0]
relative_speed = @speed#*delta_time
relative_speed = @speed*(delta_time/60.0)
if button_down?(Gosu::KbUp) || button_down?(Gosu::KbW)
@camera.z+=Math.cos(@angle_x * Math::PI / 180)*relative_speed
@@ -149,5 +150,11 @@ class IMICFPS
@draw_skydome = !@draw_skydome
end
end
def delta_time
t = Gosu.milliseconds-@delta_time
@delta_time = Gosu.milliseconds
return t
end
end
end