Removed entity management from Game, refactored Map to MapLoader and added Map to manage world

This commit is contained in:
2019-09-27 14:30:23 -05:00
parent 1bfc6e6929
commit b091a489af
20 changed files with 260 additions and 239 deletions

View File

@@ -1,8 +1,8 @@
class IMICFPS
class BoundingBoxRenderer
attr_reader :bounding_boxes, :vertex_count
def initialize(game_state:)
@game_state = game_state
def initialize(map:)
@map = map
@bounding_boxes = {}
@vertex_count = 0
@@ -205,7 +205,7 @@ class IMICFPS
glPopMatrix
found = @game_state.entities.detect { |o| o == bounding_box[:object] }
found = @map.entities.detect { |o| o == bounding_box[:object] }
unless found
@vertex_count -= @bounding_boxes[key][:vertices_size]