Added level mods and updated sprite imports

This commit is contained in:
Nathan Anderson
2022-08-04 18:05:48 -06:00
parent 417044bfda
commit 7843bf2b8d
19 changed files with 288 additions and 114 deletions
+10 -3
View File
@@ -2,6 +2,8 @@ extends KinematicBody2D
class_name Trolley
signal rogers_left_trolley()
export var TIME = 60
onready var trolley_closed_shape = $TrolleyClosedShape
export var MAX_VELOCITY = .3
@@ -10,7 +12,7 @@ var velocity := Vector2.ZERO
var has_roger := false
func _ready() -> void:
trolley_closed_shape.set_deferred("disabled", true)
set_trolley_open(true)
func _physics_process(delta: float) -> void:
velocity.x = move_toward(velocity.x, MAX_VELOCITY, delta if not has_roger else delta * 10)
@@ -22,8 +24,8 @@ func _physics_process(delta: float) -> void:
MAX_VELOCITY = 10
collider.move_and_collide(velocity * 3)
func set_trolley_open(trolley_open: bool) -> void:
trolley_closed_shape.set_deferred("disabled", trolley_open)
func _on_TrolleySeatArea_body_entered(body: Node) -> void:
if body is Player:
@@ -31,3 +33,8 @@ func _on_TrolleySeatArea_body_entered(body: Node) -> void:
print('closing trolley')
trolley_closed_shape.set_deferred("disabled", false)
func _on_TrolleySeatArea_body_exited(body: Node) -> void:
if body is Player:
emit_signal("rogers_left_trolley")