Added event handler for :entity_moved, added door script, various tweaks

This commit is contained in:
2019-09-26 16:19:01 -05:00
parent f7936b38bc
commit 8df05eda13
11 changed files with 43 additions and 14 deletions

View File

@@ -36,7 +36,6 @@ class IMICFPS
@physics = @manifest.physics # Entity affected by gravity and what not
@mass = 100 # kg
@delta_time = Gosu.milliseconds
@last_position = Vector.new(@position.x, @position.y, @position.z)
load_scripts
@@ -110,11 +109,13 @@ class IMICFPS
def update
model.update
@delta_time = Gosu.milliseconds
unless at_same_position?
Publisher.instance.publish(:entity_moved, self, self)
@bounding_box = normalize_bounding_box_with_offset if model
end
@last_position = Vector.new(@position.x, @position.y, @position.z)
end
def debug_color=(color)

View File

@@ -21,7 +21,7 @@ class IMICFPS
unless load_model_from_cache
case @type
when :obj
@model = IMICFPS::Model.new(file_path: @model_file, entity: entity, parser: Wavefront::Parser)
@model = IMICFPS::Model.new(file_path: @model_file, parser: Wavefront::Parser)
else
raise "Unsupported model type, supported models are: #{@supported_models.join(', ')}"
end