[gd_scene load_steps=7 format=2] [ext_resource path="res://platformer_controller/giovanna.gd" type="Script" id=1] [ext_resource path="res://Giovanna.tres" type="SpriteFrames" id=2] [ext_resource path="res://assets/sounds/salto1.wav" type="AudioStream" id=3] [sub_resource type="RectangleShape2D" id=4] extents = Vector2( 7, 15 ) [sub_resource type="GDScript" id=14] script/source = "extends Node2D onready var ded_timer = $DedTimer var health := 100.0 var is_night := false var in_light := false func _ready(): print(\"In light: %s\" % in_light) func _process(delta): if is_night: if not in_light and ded_timer.is_stopped(): ded_timer.start(0.4) func _on_LightCheck_entered(area): in_light = true # print(\"In light: %s\" % in_light) func _on_LightCheck_exited(area): in_light = false # print(\"In light: %s\" % in_light) func _on_DedTimer_timeout(): get_tree().change_scene(\"res://Dead.tscn\") func _on_level_day(): is_night = false func _on_level_night(): is_night = true " [sub_resource type="RectangleShape2D" id=16] extents = Vector2( 9, 15 ) [node name="Giovanna" type="KinematicBody2D"] script = ExtResource( 1 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = ExtResource( 2 ) animation = "air" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 4 ) [node name="Jump_AudioStreamPlayer" type="AudioStreamPlayer" parent="."] stream = ExtResource( 3 ) volume_db = -28.614 [node name="Camera2D" type="Camera2D" parent="."] offset = Vector2( 0, -48 ) current = true limit_left = -129 limit_top = -217 limit_right = 1123 limit_bottom = 669 limit_smoothed = true smoothing_enabled = true editor_draw_limits = true [node name="PlayerStatus" type="Node2D" parent="."] script = SubResource( 14 ) __meta__ = { "_edit_group_": true } [node name="LightCheck" type="Area2D" parent="PlayerStatus"] collision_mask = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerStatus/LightCheck"] shape = SubResource( 4 ) [node name="DedTimer" type="Timer" parent="PlayerStatus"] [node name="WallJump_Area2D" type="Area2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="WallJump_Area2D"] shape = SubResource( 16 ) [connection signal="level_day" from="." to="PlayerStatus" method="_on_level_day"] [connection signal="level_night" from="." to="PlayerStatus" method="_on_level_night"] [connection signal="area_entered" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_entered"] [connection signal="area_exited" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_exited"] [connection signal="timeout" from="PlayerStatus/DedTimer" to="PlayerStatus" method="_on_DedTimer_timeout"]