Merge branch 'master' of https://gitlab.hexaquo.at/ggjg20/bodypartfighter
This commit is contained in:
commit
f0383109f4
14 files changed
+49
-28
No files matched your search
@@ -66,6 +66,6 @@ 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"]
|
||||
@@ -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
|
||||
@@ -117,3 +120,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")
|
||||
Reference in new issue
Block a user