diff --git a/behaviours/sprite_left_right.gd b/behaviours/sprite_left_right.gd index d0fd4d1..74287ca 100644 --- a/behaviours/sprite_left_right.gd +++ b/behaviours/sprite_left_right.gd @@ -9,5 +9,5 @@ class_name SpriteLeftRight func handle_move(movement: Vector2): if movement.x > 0: texture = right_texture - else: + elif movement.x < 0: texture = left_texture diff --git a/main.tscn b/main.tscn index 3dca6bc..3b50102 100644 --- a/main.tscn +++ b/main.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=3 uid="uid://b38wkla8e7rmo"] [ext_resource type="Script" path="res://main.gd" id="1_jyg3q"] -[ext_resource type="Material" uid="uid://dpumcyplql08q" path="res://postprocess.material" id="2_3o1ux"] [ext_resource type="PackedScene" uid="uid://bkm7id1wdwywg" path="res://scenes/menu/safe_margin_container.tscn" id="2_ah6n8"] +[ext_resource type="PackedScene" uid="uid://dyodbq3yrbi87" path="res://postprocessing/postprocessing_rect.tscn" id="2_shp84"] [node name="Main" type="Node"] script = ExtResource("1_jyg3q") @@ -10,15 +10,7 @@ starting_stage = 3 [node name="PostprocessingCanvas" type="CanvasLayer" parent="."] -[node name="ColorRect" type="ColorRect" parent="PostprocessingCanvas"] -texture_filter = 1 -material = ExtResource("2_3o1ux") -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0, 0, 0, 1) +[node name="PostprocessingRect" parent="PostprocessingCanvas" instance=ExtResource("2_shp84")] [node name="InterfaceCanvas" type="CanvasLayer" parent="."] diff --git a/postprocess.material b/postprocess.material deleted file mode 100644 index 2be6893..0000000 Binary files a/postprocess.material and /dev/null differ diff --git a/postprocess.gdshader b/postprocessing/postprocess.gdshader similarity index 100% rename from postprocess.gdshader rename to postprocessing/postprocess.gdshader diff --git a/postprocessing/postprocess.material b/postprocessing/postprocess.material new file mode 100644 index 0000000..fe470e7 Binary files /dev/null and b/postprocessing/postprocess.material differ diff --git a/postprocessing/postprocessing_rect.gd b/postprocessing/postprocessing_rect.gd new file mode 100644 index 0000000..df18b94 --- /dev/null +++ b/postprocessing/postprocessing_rect.gd @@ -0,0 +1,8 @@ +extends ColorRect +class_name PostprocessingRect + + +func _input(event: InputEvent) -> void: + if event is InputEventKey: + if event.is_action_pressed(&"postprocessing_toggle"): + visible = !visible \ No newline at end of file diff --git a/postprocessing/postprocessing_rect.tscn b/postprocessing/postprocessing_rect.tscn new file mode 100644 index 0000000..5b348d6 --- /dev/null +++ b/postprocessing/postprocessing_rect.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=3 uid="uid://dyodbq3yrbi87"] + +[ext_resource type="Material" uid="uid://dpumcyplql08q" path="res://postprocessing/postprocess.material" id="1_sswlf"] +[ext_resource type="Script" path="res://postprocessing/postprocessing_rect.gd" id="2_om0qv"] + +[node name="PostprocessingRect" type="ColorRect"] +texture_filter = 1 +material = ExtResource("1_sswlf") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) +script = ExtResource("2_om0qv") diff --git a/project.godot b/project.godot index d3ccf2e..316224c 100644 --- a/project.godot +++ b/project.godot @@ -33,6 +33,11 @@ main_menu={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194317,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) ] } +postprocessing_toggle={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194311,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} [layer_names] diff --git a/temp/demon_dying.wav b/temp/demon_dying.wav index 11740af..46d3be8 100644 Binary files a/temp/demon_dying.wav and b/temp/demon_dying.wav differ diff --git a/temp/demon_dying.wav.import b/temp/demon_dying.wav.import new file mode 100644 index 0000000..8a2ee9d --- /dev/null +++ b/temp/demon_dying.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://ca7div60m5v6v" +path="res://.godot/imported/demon_dying.wav-f781d9d5c9ca2f286e7dbcaad0cf6ece.sample" + +[deps] + +source_file="res://temp/demon_dying.wav" +dest_files=["res://.godot/imported/demon_dying.wav-f781d9d5c9ca2f286e7dbcaad0cf6ece.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/temp/monster_bite.wav b/temp/monster_bite.wav index 8db3e40..d5499a4 100644 Binary files a/temp/monster_bite.wav and b/temp/monster_bite.wav differ diff --git a/temp/monster_bite.wav.import b/temp/monster_bite.wav.import new file mode 100644 index 0000000..a092928 --- /dev/null +++ b/temp/monster_bite.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://c770xsgaupkqp" +path="res://.godot/imported/monster_bite.wav-998daf3973ea57342de9f661bcc37e94.sample" + +[deps] + +source_file="res://temp/monster_bite.wav" +dest_files=["res://.godot/imported/monster_bite.wav-998daf3973ea57342de9f661bcc37e94.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/temp/tank.wav b/temp/tank.wav index aabe973..47e30a0 100644 Binary files a/temp/tank.wav and b/temp/tank.wav differ diff --git a/temp/tank.wav.import b/temp/tank.wav.import new file mode 100644 index 0000000..824282a --- /dev/null +++ b/temp/tank.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://d0feiq5s6fnux" +path="res://.godot/imported/tank.wav-76da0daecf3b365c21fcd97289993799.sample" + +[deps] + +source_file="res://temp/tank.wav" +dest_files=["res://.godot/imported/tank.wav-76da0daecf3b365c21fcd97289993799.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0