Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
d34f0749bd | |||
18d1b0b22d |
@ -1,4 +1,5 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
class_name SuperCamera
|
||||||
|
|
||||||
@onready var area_2d: Area2D = $Area2D
|
@onready var area_2d: Area2D = $Area2D
|
||||||
@onready var camera: Camera2D = $Camera2D
|
@onready var camera: Camera2D = $Camera2D
|
||||||
@ -7,6 +8,7 @@ extends Node2D
|
|||||||
@export var minimum_location = 0
|
@export var minimum_location = 0
|
||||||
@export var maximum_location = 640
|
@export var maximum_location = 640
|
||||||
|
|
||||||
|
signal became_active(SuperCamera)
|
||||||
|
|
||||||
var is_player_in_range = false
|
var is_player_in_range = false
|
||||||
var player: Node2D
|
var player: Node2D
|
||||||
@ -29,6 +31,7 @@ func _process(delta: float) -> void:
|
|||||||
|
|
||||||
func _on_body_entered(body: Node2D) -> void:
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
if body.name == "Player":
|
if body.name == "Player":
|
||||||
|
became_active.emit(self)
|
||||||
camera.make_current()
|
camera.make_current()
|
||||||
player = body
|
player = body
|
||||||
is_player_in_range = true
|
is_player_in_range = true
|
||||||
|
BIN
fonts/m6x11.ttf
Normal file
BIN
fonts/m6x11.ttf
Normal file
Binary file not shown.
35
fonts/m6x11.ttf.import
Normal file
35
fonts/m6x11.ttf.import
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="font_data_dynamic"
|
||||||
|
type="FontFile"
|
||||||
|
uid="uid://dgdurp0mujjjv"
|
||||||
|
path="res://.godot/imported/m6x11.ttf-320f9d6ef26922ee8a43f6dace8debd0.fontdata"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://fonts/m6x11.ttf"
|
||||||
|
dest_files=["res://.godot/imported/m6x11.ttf-320f9d6ef26922ee8a43f6dace8debd0.fontdata"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
Rendering=null
|
||||||
|
antialiasing=1
|
||||||
|
generate_mipmaps=false
|
||||||
|
disable_embedded_bitmaps=true
|
||||||
|
multichannel_signed_distance_field=false
|
||||||
|
msdf_pixel_range=8
|
||||||
|
msdf_size=48
|
||||||
|
allow_system_fallback=true
|
||||||
|
force_autohinter=false
|
||||||
|
hinting=1
|
||||||
|
subpixel_positioning=4
|
||||||
|
keep_rounding_remainders=true
|
||||||
|
oversampling=0.0
|
||||||
|
Fallbacks=null
|
||||||
|
fallbacks=[]
|
||||||
|
Compress=null
|
||||||
|
compress=true
|
||||||
|
preload=[]
|
||||||
|
language_support={}
|
||||||
|
script_support={}
|
||||||
|
opentype_features={}
|
35
main.gd
Normal file
35
main.gd
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
|
||||||
|
@onready var bubbles: HBoxContainer = $Bubbles
|
||||||
|
@onready var bubbles_back: TileMapLayer = $BubblesBack
|
||||||
|
@onready var bubbles_interior: TileMapLayer = $BubblesInterior
|
||||||
|
|
||||||
|
var active_camera: SuperCamera
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
for child in get_children():
|
||||||
|
if is_instance_of(child, SuperCamera):
|
||||||
|
child.became_active.connect(on_camera_became_active)
|
||||||
|
|
||||||
|
func on_camera_became_active(camera: SuperCamera):
|
||||||
|
active_camera = camera
|
||||||
|
|
||||||
|
|
||||||
|
func on_dialogue_started():
|
||||||
|
bubbles.visible = true
|
||||||
|
bubbles_back.visible = true
|
||||||
|
bubbles_interior.visible = true
|
||||||
|
|
||||||
|
func on_dialogue_ended():
|
||||||
|
bubbles.visible = false
|
||||||
|
bubbles_back.visible = false
|
||||||
|
bubbles_interior.visible = false
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
bubbles_back.global_position.x = active_camera.global_position.x
|
||||||
|
bubbles_interior.global_position.x = active_camera.global_position.x
|
||||||
|
|
1
main.gd.uid
Normal file
1
main.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://cvtt52wodbopm
|
@ -481,13 +481,13 @@ speed = 200.0
|
|||||||
acceleration = 0.177
|
acceleration = 0.177
|
||||||
|
|
||||||
[node name="Knight" type="AnimatedSprite2D" parent="."]
|
[node name="Knight" type="AnimatedSprite2D" parent="."]
|
||||||
|
visible = false
|
||||||
position = Vector2(1, -28)
|
position = Vector2(1, -28)
|
||||||
sprite_frames = SubResource("SpriteFrames_7l6ig")
|
sprite_frames = SubResource("SpriteFrames_7l6ig")
|
||||||
animation = &"idle"
|
animation = &"idle"
|
||||||
autoplay = "idle"
|
autoplay = "idle"
|
||||||
|
|
||||||
[node name="RedHood" type="AnimatedSprite2D" parent="."]
|
[node name="RedHood" type="AnimatedSprite2D" parent="."]
|
||||||
visible = false
|
|
||||||
position = Vector2(11, -19)
|
position = Vector2(11, -19)
|
||||||
sprite_frames = SubResource("SpriteFrames_mmwog")
|
sprite_frames = SubResource("SpriteFrames_mmwog")
|
||||||
animation = &"idle"
|
animation = &"idle"
|
||||||
|
@ -25,6 +25,10 @@ window/stretch/mode="viewport"
|
|||||||
|
|
||||||
project/assembly_name="ExampleProject"
|
project/assembly_name="ExampleProject"
|
||||||
|
|
||||||
|
[gui]
|
||||||
|
|
||||||
|
theme/custom_font="uid://dgdurp0mujjjv"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
move_right={
|
move_right={
|
||||||
|
1526
world_assets/bubbles.tres
Normal file
1526
world_assets/bubbles.tres
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user