Guests now have a pickup time
This commit is contained in:
parent
7db501c114
commit
84ee33474c
9
Guest.gd
9
Guest.gd
|
@ -4,10 +4,13 @@ onready var pickUpArea = $PickUpArea
|
||||||
export var guestName = "Dieter"
|
export var guestName = "Dieter"
|
||||||
export var PICKUPTRESHOLD = 100
|
export var PICKUPTRESHOLD = 100
|
||||||
export var destinationColor = Color.yellow
|
export var destinationColor = Color.yellow
|
||||||
|
var pickup_time
|
||||||
|
|
||||||
signal picked_up(color,name)
|
signal picked_up(color,name)
|
||||||
signal dropped_off_success
|
signal dropped_off_success
|
||||||
signal dropped_off_idle
|
signal dropped_off_idle
|
||||||
signal dropped_off_fail
|
signal dropped_off_fail
|
||||||
|
|
||||||
var rng = RandomNumberGenerator.new()
|
var rng = RandomNumberGenerator.new()
|
||||||
onready var sprite = $Sprite
|
onready var sprite = $Sprite
|
||||||
onready var exclusionZoneShape = $ExclusionZone/CollisionShape2D
|
onready var exclusionZoneShape = $ExclusionZone/CollisionShape2D
|
||||||
|
@ -32,10 +35,7 @@ func _ready():
|
||||||
destinationColor = colorList[n]
|
destinationColor = colorList[n]
|
||||||
#print(destinationColor)
|
#print(destinationColor)
|
||||||
sprite.modulate = destinationColor
|
sprite.modulate = destinationColor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
func _on_PickUpArea_body_entered(body):
|
func _on_PickUpArea_body_entered(body):
|
||||||
print(body.name)
|
print(body.name)
|
||||||
|
@ -43,6 +43,7 @@ func _on_PickUpArea_body_entered(body):
|
||||||
print(body.velocity.length())
|
print(body.velocity.length())
|
||||||
if body.velocity.length() <= PICKUPTRESHOLD:
|
if body.velocity.length() <= PICKUPTRESHOLD:
|
||||||
emit_signal("picked_up",destinationColor,guestName)
|
emit_signal("picked_up",destinationColor,guestName)
|
||||||
|
pickup_time = OS.get_system_time_msecs()
|
||||||
# start pickup process
|
# start pickup process
|
||||||
|
|
||||||
# we are being picked up by the player
|
# we are being picked up by the player
|
||||||
|
|
Loading…
Reference in New Issue