3 Commits

Author SHA1 Message Date
d34f0749bd feat: bubbles setup
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 7s
Create tag and build when new code gets to main / Export (push) Successful in 2m11s
2025-08-01 11:29:35 +02:00
18d1b0b22d feat: bubble location
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 2m11s
2025-08-01 11:13:14 +02:00
01aee48501 feat: player movement and animations
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 2m11s
2025-08-01 10:40:47 +02:00
10 changed files with 1730 additions and 12 deletions

View File

@ -1,4 +1,5 @@
extends Node2D
class_name SuperCamera
@onready var area_2d: Area2D = $Area2D
@onready var camera: Camera2D = $Camera2D
@ -7,6 +8,7 @@ extends Node2D
@export var minimum_location = 0
@export var maximum_location = 640
signal became_active(SuperCamera)
var is_player_in_range = false
var player: Node2D
@ -29,6 +31,7 @@ func _process(delta: float) -> void:
func _on_body_entered(body: Node2D) -> void:
if body.name == "Player":
became_active.emit(self)
camera.make_current()
player = body
is_player_in_range = true

BIN
fonts/m6x11.ttf Normal file

Binary file not shown.

35
fonts/m6x11.ttf.import Normal file
View 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
View 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
View File

@ -0,0 +1 @@
uid://cvtt52wodbopm

File diff suppressed because one or more lines are too long

View File

@ -2,26 +2,54 @@ extends CharacterBody2D
@export_range(10, 1000, 10, "or_greater")
var speed = 300.0
@export_range(0, 0.2, 0.001, "or_greater")
var acceleration = 0.5
@export_group("Airborne")
@export_range(0, 1000, 10, "or_greater")
var jump_velocity = 400.0
@export_range(0, 10, 0.1, "or_greater")
var gravity_modifier = 1
@onready var knight: AnimatedSprite2D = $Knight
@onready var red_hood: AnimatedSprite2D = $RedHood
var animated_sprites = []
func _ready() -> void:
animated_sprites = [
knight,
red_hood
]
func _physics_process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
velocity += get_gravity() * delta * gravity_modifier
# Handle jump.
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = -jump_velocity
# if Input.is_action_just_pressed("ui_accept") and is_on_floor():
# velocity.y = -jump_velocity
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction := Input.get_axis("ui_left", "ui_right")
var direction := Input.get_axis("move_left", "move_right")
if direction > 0:
for sprite in animated_sprites:
sprite.flip_h = false
if direction < 0:
for sprite in animated_sprites:
sprite.flip_h = true
if velocity.x != 0:
for sprite in animated_sprites:
sprite.play("run")
else:
for sprite in animated_sprites:
sprite.play("idle")
if direction:
velocity.x = direction * speed
var smoothed_speed = speed * smoothstep(0, 1, acceleration)
velocity.x += direction * smoothed_speed
velocity.x = clampf(velocity.x, -speed, speed)
else:
velocity.x = move_toward(velocity.x, 0, speed)

View File

@ -477,6 +477,8 @@ height = 26.0
[node name="Player" type="CharacterBody2D"]
collision_layer = 3
script = ExtResource("1_yw30f")
speed = 200.0
acceleration = 0.177
[node name="Knight" type="AnimatedSprite2D" parent="."]
visible = false
@ -492,5 +494,6 @@ animation = &"idle"
autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2(0, -13)
shape = SubResource("CapsuleShape2D_g1dw6")

View File

@ -25,6 +25,37 @@ window/stretch/mode="viewport"
project/assembly_name="ExampleProject"
[gui]
theme/custom_font="uid://dgdurp0mujjjv"
[input]
move_right={
"deadzone": 0.2,
"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":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, 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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.2,
"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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
, 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":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
interact={
"deadzone": 0.2,
"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":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
, 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":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
]
}
hit={
"deadzone": 0.2,
"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":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(196, 11),"global_position":Vector2(205, 50),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
]
}
[rendering]
textures/canvas_textures/default_texture_filter=0

1526
world_assets/bubbles.tres Normal file

File diff suppressed because it is too large Load Diff