[gd_scene load_steps=8 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="CanvasItemMaterial" id=17] light_mode = 1 [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(): is_night = false in_light = false 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): print(area.name) 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 func _on_EndgameCheck_entered(area): get_tree().change_scene(\"res://Win.tscn\") " [sub_resource type="RectangleShape2D" id=16] extents = Vector2( 9, 15 ) [node name="Giovanna" type="KinematicBody2D"] script = ExtResource( 1 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] material = SubResource( 17 ) 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_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_layer = 8 collision_mask = 8 [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerStatus/LightCheck"] shape = SubResource( 4 ) [node name="DedTimer" type="Timer" parent="PlayerStatus"] [node name="EndgameCheck" type="Area2D" parent="PlayerStatus"] collision_layer = 16 collision_mask = 16 [node name="CollisionShape2D2" type="CollisionShape2D" parent="PlayerStatus/EndgameCheck"] shape = SubResource( 4 ) [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"] [connection signal="area_entered" from="PlayerStatus/EndgameCheck" to="PlayerStatus" method="_on_EndgameCheck_entered"]