diff --git a/base modules/channel_controller.gd b/base modules/channel_controller.gd index c31632b..13e7b5b 100644 --- a/base modules/channel_controller.gd +++ b/base modules/channel_controller.gd @@ -12,14 +12,17 @@ enum Mode{ @export var channel_name : String @export var channel_scene : PackedScene -@export var dead_channel : bool +@export var dead_channel : bool # mark channel as disabled so game logic doesnt try to switch it on +@export var win_result_tex : Texture +@export var lose_result_tex : Texture @export_group("Node References") @export var offline_channel_cover : TextureRect @export var static_channel_cover : TextureRect @export var game_viewport : SubViewport +@export var result_cover : TextureRect var channel_mode : Mode = Mode.Offline - +var result_realness : float = 0 func _ready() -> void: @@ -34,6 +37,8 @@ func _ready() -> void: func _process(delta: float) -> void: offline_channel_cover.visible = channel_mode == Mode.Offline static_channel_cover.visible = channel_mode == Mode.Static + result_realness -= delta + result_cover.modulate = Color(1,1,1,result_realness) func start_channel(): start_specific_channel(channel_scene) @@ -57,8 +62,12 @@ func make_offline(): func win_channel(): GameManager.channel_win.emit() + result_cover.texture = win_result_tex + result_realness = 2 end_channel() func lose_channel(): GameManager.channel_lose.emit() + result_cover.texture = lose_result_tex + result_realness = 2 end_channel() diff --git a/base modules/test_channel.tscn b/base modules/test_channel.tscn index bf6cbeb..ae1f422 100644 --- a/base modules/test_channel.tscn +++ b/base modules/test_channel.tscn @@ -1,12 +1,14 @@ -[gd_scene load_steps=10 format=3 uid="uid://63rik2noj8id"] +[gd_scene load_steps=12 format=3 uid="uid://63rik2noj8id"] [ext_resource type="Script" uid="uid://h43mmpjmmir4" path="res://base modules/channel_controller.gd" id="1_r07ln"] [ext_resource type="Texture2D" uid="uid://cyo0wl4dt3td1" path="res://sprites/offline_channel.png" id="2_01b3p"] +[ext_resource type="Texture2D" uid="uid://bnjisd726f3na" path="res://sprites/tick.png" id="2_7qn6j"] [ext_resource type="Texture2D" uid="uid://d2xkwf58dxlvh" path="res://sprites/static/Television_static.gif_frame_00000.jpg" id="3_w8dl7"] [ext_resource type="Texture2D" uid="uid://qr2f4j3tofos" path="res://sprites/static/Television_static.gif_frame_00001.jpg" id="4_sawva"] [ext_resource type="Texture2D" uid="uid://55teduyyhqhs" path="res://sprites/static/Television_static.gif_frame_00002.jpg" id="5_7qn6j"] [ext_resource type="Texture2D" uid="uid://b2x8kmjcv1te" path="res://sprites/static/Television_static.gif_frame_00003.jpg" id="6_2hkew"] [ext_resource type="Texture2D" uid="uid://ce44420oiv8ag" path="res://sprites/static/Television_static.gif_frame_00004.jpg" id="7_5mkxt"] +[ext_resource type="Texture2D" uid="uid://c70rsm4qog0st" path="res://sprites/cross.png" id="8_sawva"] [sub_resource type="ViewportTexture" id="ViewportTexture_iix04"] viewport_path = NodePath("GameViewport") @@ -24,7 +26,7 @@ frame_3/duration = 1.0 frame_4/texture = ExtResource("7_5mkxt") frame_4/duration = 1.0 -[node name="Control" type="Control" node_paths=PackedStringArray("offline_channel_cover", "static_channel_cover", "game_viewport")] +[node name="Control" type="Control" node_paths=PackedStringArray("offline_channel_cover", "static_channel_cover", "game_viewport", "result_cover")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -35,9 +37,12 @@ size_flags_horizontal = 3 size_flags_vertical = 3 script = ExtResource("1_r07ln") channel_name = "Test" +win_result_tex = ExtResource("2_7qn6j") +lose_result_tex = ExtResource("8_sawva") offline_channel_cover = NodePath("OfflineChannelCover") static_channel_cover = NodePath("Static") game_viewport = NodePath("GameViewport") +result_cover = NodePath("GameResult") [node name="GameDisplay" type="TextureRect" parent="."] layout_mode = 1 @@ -73,6 +78,17 @@ grow_vertical = 2 texture = SubResource("AnimatedTexture_8t1w7") expand_mode = 2 +[node name="GameResult" type="TextureRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("8_sawva") +expand_mode = 2 +stretch_mode = 5 + [node name="GameViewport" type="SubViewport" parent="."] handle_input_locally = false canvas_item_default_texture_filter = 0 diff --git a/games/platformer/platformer_channel.gd b/games/platformer/platformer_channel.gd index 1ee1e26..894c158 100644 --- a/games/platformer/platformer_channel.gd +++ b/games/platformer/platformer_channel.gd @@ -13,6 +13,8 @@ func _process(delta: float) -> void: modulate = Color.WHITE else: modulate = Color.DIM_GRAY + result_realness -= delta + result_cover.modulate = Color(1,1,1,result_realness) func start_specific_channel(scene : PackedScene): var new_scene = scene.instantiate() diff --git a/sprites/cross.png b/sprites/cross.png new file mode 100644 index 0000000..689e925 Binary files /dev/null and b/sprites/cross.png differ diff --git a/sprites/cross.png.import b/sprites/cross.png.import new file mode 100644 index 0000000..564f75d --- /dev/null +++ b/sprites/cross.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c70rsm4qog0st" +path="res://.godot/imported/cross.png-7a350973591712bd0fedf6344eb40f07.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/cross.png" +dest_files=["res://.godot/imported/cross.png-7a350973591712bd0fedf6344eb40f07.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sprites/tick.png b/sprites/tick.png new file mode 100644 index 0000000..dd8efc7 Binary files /dev/null and b/sprites/tick.png differ diff --git a/sprites/tick.png.import b/sprites/tick.png.import new file mode 100644 index 0000000..6f21575 --- /dev/null +++ b/sprites/tick.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bnjisd726f3na" +path="res://.godot/imported/tick.png-901c9afaf1f4ae693dde471d3eacee7f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/tick.png" +dest_files=["res://.godot/imported/tick.png-901c9afaf1f4ae693dde471d3eacee7f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1