scene transitions

This commit is contained in:
Leon Palluch committed 2020-02-01 18:36:42 +01:00
1 parent 07d2eb94ce
commit 1690239782
7 files changed
+1128 -27

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ collide_with_areas = true
collide_with_bodies = false
[node name="Torso" parent="." instance=ExtResource( 1 )]
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Button2_pressed"]
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"]
[editable path="Torso"]
+9 -1
View File
@@ -17,12 +17,15 @@ var _viewport : Viewport
var _velx = 0
var _vely = 0
var _attachment_point : Spatial
var _default_grav
signal start_fight()
# Called when the node enters the scene tree for the first time.
func _ready():
_default_grav = PhysicsServer.area_get_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY)
PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, 0)
_torso = get_node(torsoPath) as RigidBody
_camera = get_node(cameraPath) as Camera
@@ -115,3 +118,8 @@ func delete_body_part():
if body_part != null:
body_part.queue_free()
func _on_Start_pressed():
PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, _default_grav)
emit_signal("start_fight")