Fixed crash when jumping

This commit is contained in:
2019-09-27 14:33:35 -05:00
parent b091a489af
commit f3d3ceebb8
2 changed files with 2 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ class IMICFPS
end end
def jump def jump
if InputMapper.down?(:jump) && window.current_state.collision_manager.on_ground?(self) if InputMapper.down?(:jump) && window.current_state.map.collision_manager.on_ground?(self)
@velocity.y = 1.5 @velocity.y = 1.5
end end
end end

View File

@@ -3,6 +3,7 @@ class IMICFPS
include EntityManager include EntityManager
include LightManager include LightManager
attr_reader :collision_manager
attr_reader :gravity attr_reader :gravity
def initialize(map_loader:, gravity: IMICFPS::GRAVITY) def initialize(map_loader:, gravity: IMICFPS::GRAVITY)
@map_loader = map_loader @map_loader = map_loader