debug / dialogue / multiple / multiple.tscn
Diagram
Overridden virtual functions
_ready
func _ready() -> void:
%MonumentDescription.hide()
func _ready() -> void:
if not owner: start()
func _ready() -> void:
if not owner: start()
func _ready() -> void:
playable = true
current = self
restart_position = global_position
turn_right()
_input
func _input(event_: InputEvent) -> void:
if not state == State.ENTERED: return
if event_.is_action_pressed(&'dialogue_start'):
start()
_physics_process
func _physics_process(delta: float) -> void:
var dx := Input.get_axis(&'move_left', &'move_right')
var dy := Input.get_axis(&'move_up', &'move_down')
var direction := Vector2(dx, dy)
var last_state := state
state = compute_state(delta, direction)
match state:
State.CLIMBING:
dx = 0
velocity.y = dy * CLIMBING_SPEED
State.DASHED:
velocity = direction.normalized() * DASH_SPEED
State.DASHING:
velocity *= DASH_ATTENUATION * delta
State.EXHAUSTED:
dx = 0
State.FAILED:
velocity.x = lerp(velocity.x, 0.0, 0.2)
velocity.y = lerp(velocity.y, 0.0, 0.2)
State.FALLING, State.SLIDING:
if last_state == State.CLIMBING \
and dy < 0:
velocity.y = JUMP_VELOCITY * 0.8
else:
var move_x := dx * SPEED * 0.8
if velocity.x * dx < 0: move_x *= 0.1
velocity.x = lerp(velocity.x, move_x, 0.2)
velocity.y += GRAVITY * delta
if state == State.SLIDING: velocity.y *= 0.8
velocity.y = [velocity.y, MAX_VELOCITY_Y].min()
if falling_time < 0.1 \
and Input.is_action_just_released(&'move_jump'):
velocity.y += DOWNFORCE_ON_LITTLE_JUMP * delta
State.JUMPED:
velocity.y = JUMP_VELOCITY
State.KICKED:
velocity.y = JUMP_VELOCITY * 0.9
velocity.x = get_wall_normal().x * DASH_SPEED * 0.4
State.LOCKED:
dx = 0
velocity = Vector2(0, 0)
_: pass
if not playable: dx = 0
if not (state == State.DASHED \
or state == State.DASHING \
or state == State.FALLING \
or state == State.KICKED
):
if dx: velocity.x = dx * SPEED
else: velocity.x = move_toward(velocity.x, 0, SPEED*0.2)
if state == State.JUMPED:
velocity += jump_boost
jump_boost = Vector2(0, 0)
animate(playable)
move_and_slide()
Instantiators
|
Caution
|
No other scene instantiate this scene. |
Scene Tree
-
Dialogue Control
-
StageGround0 res://src/stages/0/stage_ground_0.tscn
-
CameraFrame res://src/stages/frame/camera_frame.tscn
-
YoungGuy res://src/dialogue/chapters/1/young_guy/young_guy.tscn
-
OldWoman res://src/dialogue/chapters/0/old_woman/old_woman.tscn
-
Player res://src/player/player.tscn
-
Signal Connections
|
Note
|
No signal connections. |
Properties
| Name | Value |
|---|---|
layout_mode |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
grow_horizontal |
|
grow_vertical |
|
| Name | Value |
|---|---|
tile_map_data |
|
| Name | Value |
|---|---|
position |
|
| Name | Value |
|---|---|
position |
|
| Name | Value |
|---|---|
position |
|
| Name | Value |
|---|---|
position |
|
| Name | Value |
|---|---|
position |
|