mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Added event handler for :entity_moved, added door script, various tweaks
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user