From f1c40bb47ed2fc02352f46ca5f08024ba2d366eb Mon Sep 17 00:00:00 2001 From: cakipaul Date: Fri, 7 Feb 2025 20:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=AE=E5=88=AE=E4=B9=90=EF=BC=9A=E7=89=A9?= =?UTF-8?q?=E5=93=81=E4=BA=92=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/art/临时草稿/c02_第一章/刮刮乐.png | Bin 0 -> 1470 bytes .../art/临时草稿/c02_第一章/刮刮乐.png.import | 34 +++++++ .../art/临时草稿/{ => c02_第一章}/煤油灯.png | Bin .../{ => c02_第一章}/煤油灯.png.import | 6 +- .../临时草稿/{ => c02_第一章}/煤油灯_点燃.png | Bin .../{ => c02_第一章}/煤油灯_点燃.png.import | 6 +- scene/entity/ux/刮刮乐.gd | 9 ++ scene/entity/ux/刮刮乐.gdshader | 8 ++ scene/entity/ux/刮刮乐.tscn | 39 +++++++ scene/entity/ux/刮刮乐mask.gd | 96 ++++++++++++++++++ scene/ground/scene/c02/s02_走道.tscn | 4 +- scene/little_game/书架/陆小蝶名字.gd | 12 ++- 12 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 asset/art/临时草稿/c02_第一章/刮刮乐.png create mode 100644 asset/art/临时草稿/c02_第一章/刮刮乐.png.import rename asset/art/临时草稿/{ => c02_第一章}/煤油灯.png (100%) rename asset/art/临时草稿/{ => c02_第一章}/煤油灯.png.import (69%) rename asset/art/临时草稿/{ => c02_第一章}/煤油灯_点燃.png (100%) rename asset/art/临时草稿/{ => c02_第一章}/煤油灯_点燃.png.import (68%) create mode 100644 scene/entity/ux/刮刮乐.gd create mode 100644 scene/entity/ux/刮刮乐.gdshader create mode 100644 scene/entity/ux/刮刮乐.tscn create mode 100644 scene/entity/ux/刮刮乐mask.gd diff --git a/asset/art/临时草稿/c02_第一章/刮刮乐.png b/asset/art/临时草稿/c02_第一章/刮刮乐.png new file mode 100644 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zzD_$6tc6jDYtaPwb~?#7DKRkC!k7+H)K2DrxKOek506xsB<_vkTo&gX{5M{zlWenK}T&=tiW*Ez_E*CP# z41*vHfmSG~KK;r9%EEkb`J*JqVU6uSRq%vRA_&3|1Yrn*Fa((q#+z?DWF0Ss*?sX8 zc3(V&Qh5qW<*DdB-r^T4`{S=e`1G?|eJ@sqw<>rk45nJG4wO|Y6=7Xm&e~CRWq2zL zn-JS#fv8Ed@@lmzY^Q^_!r(~)42n>xRQe_@bB3;Syc7mcf|?L7n9MD@&hb(h-Yq<$ zTq4?MnqL4Ee(3nCh3}0!PaD~dCHvXh@I%KM1Yrn*Fa$vug77Qz5R$JJL6|@w5J-Xl Y0OEqsdPu^k8~^|S07*qoM6N<$f;KI)W&i*H literal 0 HcmV?d00001 diff --git a/asset/art/临时草稿/c02_第一章/刮刮乐.png.import b/asset/art/临时草稿/c02_第一章/刮刮乐.png.import new file mode 100644 index 00000000..c781cd7b --- /dev/null +++ b/asset/art/临时草稿/c02_第一章/刮刮乐.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://djvwe8dh4fmn" +path="res://.godot/imported/刮刮乐.png-2c82b14d7d14852fdee98f2c14a98643.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://asset/art/临时草稿/c02_第一章/刮刮乐.png" +dest_files=["res://.godot/imported/刮刮乐.png-2c82b14d7d14852fdee98f2c14a98643.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/asset/art/临时草稿/煤油灯.png b/asset/art/临时草稿/c02_第一章/煤油灯.png similarity index 100% rename from asset/art/临时草稿/煤油灯.png rename to asset/art/临时草稿/c02_第一章/煤油灯.png diff --git a/asset/art/临时草稿/煤油灯.png.import b/asset/art/临时草稿/c02_第一章/煤油灯.png.import similarity index 69% rename from asset/art/临时草稿/煤油灯.png.import rename to asset/art/临时草稿/c02_第一章/煤油灯.png.import index 301dc6a4..d390b34f 100644 --- a/asset/art/临时草稿/煤油灯.png.import +++ b/asset/art/临时草稿/c02_第一章/煤油灯.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c4c7t2lttcf0a" -path="res://.godot/imported/煤油灯.png-4b4e3a68e5a7458aa1134ee578e8c883.ctex" +path="res://.godot/imported/煤油灯.png-9603866113eb55ff801241201ee8d7aa.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://asset/art/临时草稿/煤油灯.png" -dest_files=["res://.godot/imported/煤油灯.png-4b4e3a68e5a7458aa1134ee578e8c883.ctex"] +source_file="res://asset/art/临时草稿/c02_第一章/煤油灯.png" +dest_files=["res://.godot/imported/煤油灯.png-9603866113eb55ff801241201ee8d7aa.ctex"] [params] diff --git a/asset/art/临时草稿/煤油灯_点燃.png b/asset/art/临时草稿/c02_第一章/煤油灯_点燃.png similarity index 100% rename from asset/art/临时草稿/煤油灯_点燃.png rename to asset/art/临时草稿/c02_第一章/煤油灯_点燃.png diff --git a/asset/art/临时草稿/煤油灯_点燃.png.import b/asset/art/临时草稿/c02_第一章/煤油灯_点燃.png.import similarity index 68% rename from asset/art/临时草稿/煤油灯_点燃.png.import rename to asset/art/临时草稿/c02_第一章/煤油灯_点燃.png.import index 5c6a052e..9c30e18e 100644 --- a/asset/art/临时草稿/煤油灯_点燃.png.import +++ b/asset/art/临时草稿/c02_第一章/煤油灯_点燃.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://doqtpiaf1weqc" -path="res://.godot/imported/煤油灯_点燃.png-aace2ea6aeaad791da0fdcb57c8433a0.ctex" +path="res://.godot/imported/煤油灯_点燃.png-0a2f32ef537f73f027921117053029ee.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://asset/art/临时草稿/煤油灯_点燃.png" -dest_files=["res://.godot/imported/煤油灯_点燃.png-aace2ea6aeaad791da0fdcb57c8433a0.ctex"] +source_file="res://asset/art/临时草稿/c02_第一章/煤油灯_点燃.png" +dest_files=["res://.godot/imported/煤油灯_点燃.png-0a2f32ef537f73f027921117053029ee.ctex"] [params] diff --git a/scene/entity/ux/刮刮乐.gd b/scene/entity/ux/刮刮乐.gd new file mode 100644 index 00000000..b8339419 --- /dev/null +++ b/scene/entity/ux/刮刮乐.gd @@ -0,0 +1,9 @@ +# @tool +extends Sprite2D + + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + diff --git a/scene/entity/ux/刮刮乐.gdshader b/scene/entity/ux/刮刮乐.gdshader new file mode 100644 index 00000000..70295e68 --- /dev/null +++ b/scene/entity/ux/刮刮乐.gdshader @@ -0,0 +1,8 @@ +shader_type canvas_item; + +uniform float grey_scale = .33; + +void fragment() { + COLOR.a = step(COLOR.r, .0); + COLOR.rgb = vec3(grey_scale - COLOR.r); +} diff --git a/scene/entity/ux/刮刮乐.tscn b/scene/entity/ux/刮刮乐.tscn new file mode 100644 index 00000000..a8b84bb2 --- /dev/null +++ b/scene/entity/ux/刮刮乐.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=8 format=3 uid="uid://bvnclp341hxoh"] + +[ext_resource type="Script" path="res://scene/entity/ux/刮刮乐.gd" id="1_dja3c"] +[ext_resource type="Texture2D" uid="uid://djvwe8dh4fmn" path="res://asset/art/临时草稿/c02_第一章/刮刮乐.png" id="1_ffdds"] +[ext_resource type="Shader" path="res://scene/entity/ux/刮刮乐.gdshader" id="3_er5jo"] +[ext_resource type="Script" path="res://scene/entity/ux/刮刮乐mask.gd" id="4_wp0ek"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_rw7b6"] +shader = ExtResource("3_er5jo") +shader_parameter/grey_scale = 0.33 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +"format": "Lum8", +"height": 18, +"mipmaps": false, +"width": 49 +} + +[sub_resource type="ImageTexture" id="ImageTexture_o178p"] +image = SubResource("Image_ra1lb") + +[node name="刮刮乐" type="Sprite2D"] +position = Vector2(127, 138) +texture = ExtResource("1_ffdds") +script = ExtResource("1_dja3c") + +[node name="mask" type="TextureRect" parent="."] +modulate = Color(0.475927, 0.475927, 0.475927, 1) +material = SubResource("ShaderMaterial_rw7b6") +custom_minimum_size = Vector2(49, 18) +offset_left = -24.0 +offset_top = 6.0 +offset_right = 25.0 +offset_bottom = 24.0 +texture = SubResource("ImageTexture_o178p") +script = ExtResource("4_wp0ek") +area_size = Vector2(49, 18) diff --git a/scene/entity/ux/刮刮乐mask.gd b/scene/entity/ux/刮刮乐mask.gd new file mode 100644 index 00000000..43c53009 --- /dev/null +++ b/scene/entity/ux/刮刮乐mask.gd @@ -0,0 +1,96 @@ +@tool +extends TextureRect + +signal shaven(progress: float) + +@export var area_size := Vector2(40, 20): + set(val): + area_size = val + custom_minimum_size = val + if is_node_ready(): + _init_bit_mask() +@export var debug_reload := false: + set(val): + debug_reload = false + if is_node_ready(): + _init_bit_mask() + +# points inside radius 5 circle +var brush_points := generate_brush_points(5) +var bit_mask: BitMap + +func _ready() -> void: + # init bit mask + _init_bit_mask() + + +# a solid circle brush, center = (0, 0) +func generate_brush_points(radius: int) -> PackedVector2Array: + var points := PackedVector2Array() + # Check each pixel in square area + for x in range(-radius, radius + 1): + for y in range(-radius, radius + 1): + # If point is within circle radius + if x * x + y * y <= radius * radius: + points.append(Vector2(x, y)) + return points + + +func _init_bit_mask() -> void: + if not bit_mask: + bit_mask = BitMap.new() + bit_mask.create(area_size) + texture = ImageTexture.create_from_image(bit_mask.convert_to_image()) + + +func _shave(mouse_pos: Vector2) -> void: + if not mouse_pressing: + return + var updated = false + for point in brush_points: + var pos = mouse_pos + point + if pos.x < 0 or pos.x >= area_size.x or pos.y < 0 or pos.y >= area_size.y: + continue + bit_mask.set_bitv(pos, true) + updated = true + texture.update(bit_mask.convert_to_image()) + if updated: + _send_signal() + + +func _send_signal() -> void: + var total = area_size.x * area_size.y + var true_bit_count = bit_mask.get_true_bit_count() + var progress = float(true_bit_count) / float(total) + shaven.emit(progress) + + +var mouse_pressing = false + + +# 可以刮出区域 +func _gui_input(event: InputEvent) -> void: + # 通过鼠标点击拖动,刮开区域,set_bit 一个 brush_size 的圆形区域为 true + # 每次更新后,bit_mask 会更新到 texture 上 + # 通过 shaven 信号,通知外部,刮开了多少区域 + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT and event.pressed: + # 先设置 mouse_pressing 为 true + mouse_pressing = true + # 刮开区域 + _shave(event.position) + accept_event() + elif event.button_index == MOUSE_BUTTON_LEFT and not event.pressed: + mouse_pressing = false + accept_event() + elif event is InputEventMouseMotion and mouse_pressing: + _shave(event.position) + accept_event() + # elif event is InputEventScreenTouch: + # if event.pressed: + # mouse_pressing = true + # _shave(event.position) + # accept_event() + # elif not event.pressed: + # mouse_pressing = false + # accept_event() diff --git a/scene/ground/scene/c02/s02_走道.tscn b/scene/ground/scene/c02/s02_走道.tscn index 82d88307..df577c94 100644 --- a/scene/ground/scene/c02/s02_走道.tscn +++ b/scene/ground/scene/c02/s02_走道.tscn @@ -13,8 +13,8 @@ [ext_resource type="AudioStream" uid="uid://dq2ndg5yd3rps" path="res://asset/audio/sfx/c02/出现.mp3" id="11_u68d7"] [ext_resource type="PackedScene" uid="uid://ci5anaxsa1apl" path="res://scene/entity/local_inspectable.tscn" id="12_0fckv"] [ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="13_ck13g"] -[ext_resource type="Texture2D" uid="uid://c4c7t2lttcf0a" path="res://asset/art/临时草稿/煤油灯.png" id="14_db4pu"] -[ext_resource type="Texture2D" uid="uid://doqtpiaf1weqc" path="res://asset/art/临时草稿/煤油灯_点燃.png" id="15_5rpxj"] +[ext_resource type="Texture2D" uid="uid://c4c7t2lttcf0a" path="res://asset/art/临时草稿/c02_第一章/煤油灯.png" id="14_db4pu"] +[ext_resource type="Texture2D" uid="uid://doqtpiaf1weqc" path="res://asset/art/临时草稿/c02_第一章/煤油灯_点燃.png" id="15_5rpxj"] [ext_resource type="Texture2D" uid="uid://b7gyapghy3tsy" path="res://asset/art/neutral_point_light.png" id="16_asses"] [ext_resource type="AudioStream" uid="uid://dvwiuesd0qi1l" path="res://asset/audio/sfx/ui/门牌互动音.wav" id="16_d08tt"] [ext_resource type="AudioStream" uid="uid://dky3j8lwcy5sk" path="res://asset/audio/sfx/ui/物品查看.mp3" id="17_lqks2"] diff --git a/scene/little_game/书架/陆小蝶名字.gd b/scene/little_game/书架/陆小蝶名字.gd index ef766ce0..5530801f 100644 --- a/scene/little_game/书架/陆小蝶名字.gd +++ b/scene/little_game/书架/陆小蝶名字.gd @@ -15,15 +15,17 @@ func play() -> void: visible = true var tween = create_tween() tween.tween_interval(3.0) - tween.tween_property(self, "self_modulate:a", 0.0, 15.0) var final_modulate = Color.PALE_VIOLET_RED - tween.parallel().tween_property(get_parent(), "modulate", final_modulate, 15.0) + tween.tween_property(self, "self_modulate:a", 0.0, 4.0) + tween.parallel().tween_property(get_parent(), "modulate", final_modulate, 12.0) tween = create_tween() - var interval = 3. + tween.tween_interval(7.0) + # 小蝶名字消失后再显示其他名字 + var interval = 2.4 for c in self.get_children(): c.visible = false - tween.tween_interval(interval) tween.tween_callback(_stamp_seal.bind(c)) + tween.tween_interval(interval) interval = max(interval - 0.3, 0.4) @@ -43,7 +45,7 @@ func _stamp_seal(seal: Sprite2D) -> void: seal.visible = true var origin_scale = seal.scale create_tween().tween_property(seal, "scale", origin_scale * Vector2(1.05, 1.05), .1) - create_tween().tween_property(seal, "scale", origin_scale * Vector2(1.0, 1.), .1) + create_tween().tween_property(seal, "scale", origin_scale * Vector2(1.0, 1.), .1) func _draw() -> void: