mirror of
https://github.com/mightypanders/GMTKJam2021.git
synced 2025-01-30 21:59:55 +01:00
merge main
This commit is contained in:
commit
16cb77fd37
@ -1,3 +1,4 @@
|
||||
class_name DropOffPoint
|
||||
extends Node2D
|
||||
export var destinationColor = Color.yellow
|
||||
onready var sprite = $Sprite
|
||||
|
19
Guest.gd
19
Guest.gd
@ -45,22 +45,29 @@ var follow_node = null
|
||||
var follow_guest = null
|
||||
var follow_pos = global_position
|
||||
|
||||
func set_state(state):
|
||||
if state == states.delivered:
|
||||
pickUpArea.monitorable = false
|
||||
pickUpArea.monitoring = false
|
||||
collision.disabled = true
|
||||
if state == states.waiting:
|
||||
collision.disabled = false
|
||||
mode = RigidBody2D.MODE_KINEMATIC
|
||||
if state == states.tethered:
|
||||
collision.disabled = false
|
||||
mode = RigidBody2D.MODE_STATIC
|
||||
|
||||
func _physics_process(delta):
|
||||
if currentState == states.waiting:
|
||||
linear_velocity.move_toward(Vector2.ZERO,5.0)
|
||||
collision.disabled = false
|
||||
elif currentState == states.tethered:
|
||||
collision.disabled = true
|
||||
mode = RigidBody2D.MODE_STATIC
|
||||
var rot_dir = get_angle_to(follow_pos)
|
||||
rotation += (rot_dir + deg2rad(90))*0.2
|
||||
var distance = follow_pos.distance_to(global_position)
|
||||
global_position = follow_pos
|
||||
pass
|
||||
elif currentState == states.delivered:
|
||||
pickUpArea.monitorable = false
|
||||
pickUpArea.monitoring = false
|
||||
collision.disabled = true
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if delivered != null and OS.get_system_time_msecs() - delivered > 1000:
|
||||
|
10
Playa.gd
10
Playa.gd
@ -109,10 +109,10 @@ func remove_Guests_from_Line(color):
|
||||
func _on_PickupCheckArea_area_entered(area):
|
||||
|
||||
if area.get_parent().is_in_group("DropOffPoint"):
|
||||
print("It's a DOP")
|
||||
#print("It's a DOP")
|
||||
var dop = area.get_parent()
|
||||
var color = dop.destinationColor
|
||||
print(color)
|
||||
#print(color)
|
||||
last_in_line = remove_Guests_from_Line(color)
|
||||
#drop all guests after first guest.color == DOP.color, also vanish all guests.color == DOP.color
|
||||
pass
|
||||
@ -124,10 +124,10 @@ func _on_PickupCheckArea_area_entered(area):
|
||||
#print("We already have you in line")
|
||||
pass
|
||||
else:
|
||||
print("Area has parent %s" % area.get_parent())
|
||||
print("It's a Guest")
|
||||
#print("Area has parent %s" % area.get_parent())
|
||||
#print("It's a Guest")
|
||||
last_in_line = add_Guest_to_Line(last_in_line,area.get_parent())
|
||||
print(last_in_line)
|
||||
#print(last_in_line)
|
||||
|
||||
print(guests)
|
||||
|
||||
|
@ -1481,7 +1481,7 @@ margin_right = 1331.08
|
||||
margin_bottom = 74.3368
|
||||
|
||||
[node name="GameTime" type="Timer" parent="."]
|
||||
wait_time = 35.853
|
||||
wait_time = 120.0
|
||||
autostart = true
|
||||
|
||||
[node name="GUI2" parent="." instance=ExtResource( 41 )]
|
||||
|
@ -8,6 +8,16 @@
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "Node2D",
|
||||
"class": "DropOffPoint",
|
||||
"language": "GDScript",
|
||||
"path": "res://DropOffPoint.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"DropOffPoint": ""
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="City Bound"
|
||||
|
Loading…
Reference in New Issue
Block a user