Reorganize file structure of project
This commit is contained in:
19
Entities/Buildings/home_01.tscn
Normal file
19
Entities/Buildings/home_01.tscn
Normal file
@@ -0,0 +1,19 @@
|
||||
[gd_scene format=3 uid="uid://bjufxlsrlcuas"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b4pkng5oqj7ex" path="res://Assets/Sprites/Buildings/Houses/Wood/House_1_Wood_Base_Red.png" id="1_khh77"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_khh77"]
|
||||
size = Vector2(64, 32)
|
||||
|
||||
[node name="Home 01" type="StaticBody2D" unique_id=2084767105]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2100279943]
|
||||
position = Vector2(0, 32)
|
||||
shape = SubResource("RectangleShape2D_khh77")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=2016922056]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 48)
|
||||
texture = ExtResource("1_khh77")
|
||||
offset = Vector2(0, -48)
|
||||
33
Entities/Characters/Animals/Chicken/Scripts/npc_chicken.gd
Normal file
33
Entities/Characters/Animals/Chicken/Scripts/npc_chicken.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
enum States {
|
||||
IDLE,
|
||||
PECKING
|
||||
}
|
||||
|
||||
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
var current_state := States.IDLE
|
||||
var pecking_sched := randf_range(8.0, 25.0)
|
||||
var pecking_timer := 0.0
|
||||
|
||||
func _ready() -> void:
|
||||
_print_sched()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if current_state == States.IDLE:
|
||||
pecking_timer += delta
|
||||
if pecking_timer >= pecking_sched:
|
||||
current_state = States.PECKING
|
||||
animated_sprite_2d.play("pecking")
|
||||
await animated_sprite_2d.animation_finished
|
||||
animated_sprite_2d.play("idle")
|
||||
pecking_sched = randf_range(8.0, 25.0)
|
||||
pecking_timer = 0
|
||||
current_state = States.IDLE
|
||||
_print_sched()
|
||||
|
||||
|
||||
func _print_sched() -> void:
|
||||
print("%s Pecking Schedule: %f" % [name, pecking_sched])
|
||||
@@ -0,0 +1 @@
|
||||
uid://c5pt6iroi01si
|
||||
99
Entities/Characters/Animals/Chicken/npc_chicken.tscn
Normal file
99
Entities/Characters/Animals/Chicken/npc_chicken.tscn
Normal file
@@ -0,0 +1,99 @@
|
||||
[gd_scene format=3 uid="uid://clqfyxjtn67m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c5pt6iroi01si" path="res://Entities/Characters/Animals/Chicken/Scripts/npc_chicken.gd" id="1_etrql"]
|
||||
[ext_resource type="Texture2D" uid="uid://d4lf74neoqf4p" path="res://Assets/Spritesheets/Animals/Chickens/Chicken_01.png" id="1_hjr72"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_etrql"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cps5e"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hjr72"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(0, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hgb1c"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(32, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b7crd"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(64, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4ggxf"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(96, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m8e2q"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(128, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_myiu2"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(160, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wmbj4"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(192, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t08bh"]
|
||||
atlas = ExtResource("1_hjr72")
|
||||
region = Rect2(224, 64, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_hgb1c"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_etrql")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cps5e")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 2.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hjr72")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hgb1c")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b7crd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_4ggxf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m8e2q")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_myiu2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wmbj4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t08bh")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"pecking",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="Npc Chicken" type="CharacterBody2D" unique_id=1839801182]
|
||||
y_sort_enabled = true
|
||||
script = ExtResource("1_etrql")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1119508709]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 6)
|
||||
sprite_frames = SubResource("SpriteFrames_hgb1c")
|
||||
animation = &"pecking"
|
||||
autoplay = "idle"
|
||||
offset = Vector2(0, -6)
|
||||
32
Entities/Characters/Animals/Frog/npc_frog.tscn
Normal file
32
Entities/Characters/Animals/Frog/npc_frog.tscn
Normal file
@@ -0,0 +1,32 @@
|
||||
[gd_scene format=3 uid="uid://c2p8fteeqyikf"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ksgfv6hgw8i" path="res://Assets/Spritesheets/Animals/Frogs/Frog_01.png" id="1_rggf3"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xdptu"]
|
||||
atlas = ExtResource("1_rggf3")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4bqs7"]
|
||||
atlas = ExtResource("1_rggf3")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_ui74g"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_xdptu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_4bqs7")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 2.0
|
||||
}]
|
||||
|
||||
[node name="Npc Frog" type="CharacterBody2D" unique_id=1908167002]
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1739011570]
|
||||
sprite_frames = SubResource("SpriteFrames_ui74g")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.9973062
|
||||
@@ -0,0 +1,10 @@
|
||||
extends Node
|
||||
|
||||
@export var state_machine: PlayerStateMachine
|
||||
|
||||
# Public Methods
|
||||
func OnMovementInput(_movement_vector: Vector2) -> void:
|
||||
var current_state := state_machine.GetCurrentStateEnum()
|
||||
if current_state == PlayerStateMachine.States.IDLE:
|
||||
var idle_state := state_machine.current_state as PlayerIdleState
|
||||
idle_state.QueueMovement()
|
||||
@@ -0,0 +1 @@
|
||||
uid://ctoxjn2rvtjs6
|
||||
33
Entities/Characters/Player/Scripts/States/base_state.gd
Normal file
33
Entities/Characters/Player/Scripts/States/base_state.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
class_name BaseState
|
||||
extends Node
|
||||
|
||||
@export var state_machine: PlayerStateMachine
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
push_error("Unimplemented Method: BaseState.GetName")
|
||||
return PlayerStateMachine.States.IDLE
|
||||
|
||||
|
||||
func GetAnimationBaseName() -> String:
|
||||
var state: String = PlayerStateMachine.States.keys()[GetStateEnum()]
|
||||
return state.to_lower()
|
||||
|
||||
|
||||
func Enter(_extra_parameters: Dictionary) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func Exit() -> void:
|
||||
pass
|
||||
|
||||
|
||||
func Update(_delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func IsActive() -> bool:
|
||||
return state_machine.GetCurrentStateEnum() == GetStateEnum()
|
||||
|
||||
|
||||
func IsStateActionable() -> bool:
|
||||
return true
|
||||
@@ -0,0 +1 @@
|
||||
uid://cb57l5vpq5bee
|
||||
29
Entities/Characters/Player/Scripts/States/cutscene_state.gd
Normal file
29
Entities/Characters/Player/Scripts/States/cutscene_state.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends BaseState
|
||||
class_name PlayerCutsceneState
|
||||
|
||||
@onready var interact_scanner: InteractScanner = $"../../../Marker2D/InteractScanner"
|
||||
|
||||
# Public Methods
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.CUTSCENE
|
||||
|
||||
|
||||
func GetAnimationBaseName() -> String:
|
||||
return "idle"
|
||||
|
||||
|
||||
func Enter(_extra_parameters: Dictionary) -> void:
|
||||
print("Cutscene Started")
|
||||
interact_scanner.disable_interactions = true
|
||||
|
||||
|
||||
func Exit() -> void:
|
||||
interact_scanner.disable_interactions = false
|
||||
|
||||
|
||||
func OnCutsceneEnded() -> void:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
|
||||
|
||||
|
||||
func IsStateActionable() -> bool:
|
||||
return false
|
||||
@@ -0,0 +1 @@
|
||||
uid://bnontuqj3cnom
|
||||
@@ -0,0 +1,37 @@
|
||||
extends BaseState
|
||||
|
||||
signal PlayerBeganDrawingBow
|
||||
|
||||
@export var strafing_speed := 35
|
||||
@export var movement_componenent: MovementComponent
|
||||
@export var body: CharacterBody2D
|
||||
|
||||
var used_item_action: String
|
||||
var animation_finished := false
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.DRAWING_BOW
|
||||
|
||||
|
||||
func Enter(extra_parameters: Dictionary) -> void:
|
||||
animation_finished = false
|
||||
used_item_action = extra_parameters.action_name
|
||||
PlayerBeganDrawingBow.emit()
|
||||
|
||||
|
||||
func Update(_delta: float) -> void:
|
||||
if !animation_finished:
|
||||
return
|
||||
|
||||
if !Input.is_action_pressed(used_item_action):
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.FIRING_ARROW)
|
||||
return
|
||||
|
||||
var movement_vector := movement_componenent.movement_vector
|
||||
if movement_vector != Vector2.ZERO:
|
||||
body.velocity = movement_vector * strafing_speed
|
||||
body.move_and_slide()
|
||||
|
||||
|
||||
func OnDrawingBowAnimationFinished() -> void:
|
||||
animation_finished = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://bnp1vowmu15lg
|
||||
@@ -0,0 +1,31 @@
|
||||
extends BaseState
|
||||
class_name FiringArrowState
|
||||
|
||||
signal PlayerBeganFiringArrow
|
||||
signal ArrowFired(spawn_position: Vector2, direction: Vector2)
|
||||
|
||||
@export var direction_component: FacingDirectionComponent
|
||||
@export var arrow_spawn_marker: Marker2D
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.FIRING_ARROW
|
||||
|
||||
|
||||
func Enter(_extra_parameters: Dictionary) -> void:
|
||||
PlayerBeganFiringArrow.emit()
|
||||
|
||||
var position := arrow_spawn_marker.global_position
|
||||
var direction := Vector2.ZERO
|
||||
if direction_component.current_direction == Enums.Directions.LEFT:
|
||||
direction = Vector2.LEFT
|
||||
elif direction_component.current_direction == Enums.Directions.RIGHT:
|
||||
direction = Vector2.RIGHT
|
||||
elif direction_component.current_direction == Enums.Directions.UP:
|
||||
direction = Vector2.UP
|
||||
elif direction_component.current_direction == Enums.Directions.DOWN:
|
||||
direction = Vector2.DOWN
|
||||
ArrowFired.emit(position, direction)
|
||||
|
||||
|
||||
func OnFiringArrowAnimationFinished() -> void:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cd2ewadcm8oi5
|
||||
47
Entities/Characters/Player/Scripts/States/idle_state.gd
Normal file
47
Entities/Characters/Player/Scripts/States/idle_state.gd
Normal file
@@ -0,0 +1,47 @@
|
||||
extends BaseState
|
||||
class_name PlayerIdleState
|
||||
|
||||
@export var movement_component: MovementComponent
|
||||
|
||||
signal PlayerBecameIdle
|
||||
|
||||
var _sit_queued := false
|
||||
var _sit_queue_pos: Vector2
|
||||
var _sit_queue_dir: Enums.Directions
|
||||
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.IDLE
|
||||
|
||||
|
||||
func Enter(_extra_parameters: Dictionary) -> void:
|
||||
PlayerBecameIdle.emit()
|
||||
|
||||
|
||||
func Update(_delta: float) -> void:
|
||||
var item_a := Input.is_action_just_pressed("use_item_a")
|
||||
|
||||
if item_a:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.USING_ITEM_A, {})
|
||||
return
|
||||
|
||||
if _sit_queued:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.SITTING, {"pos": _sit_queue_pos, "dir": _sit_queue_dir})
|
||||
_sit_queued = false
|
||||
return
|
||||
|
||||
if movement_component.movement_vector != Vector2.ZERO:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.WALKING)
|
||||
|
||||
|
||||
func OnSitOnFurnitureTriggered(sitting_position: Vector2, sitting_direction: Enums.Directions) -> void:
|
||||
if state_machine.GetCurrentStateEnum() != GetStateEnum():
|
||||
return
|
||||
|
||||
_sit_queued = true
|
||||
_sit_queue_pos = sitting_position
|
||||
_sit_queue_dir = sitting_direction
|
||||
|
||||
|
||||
func OnCutsceneStarted() -> void:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.CUTSCENE)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dkmc1t43gomdb
|
||||
@@ -0,0 +1,30 @@
|
||||
extends BaseState
|
||||
class_name PlayerPlayAnimationState
|
||||
|
||||
signal PlayAnimation(animation_name: String)
|
||||
signal AnimationFinished(animation_name: String)
|
||||
|
||||
var current_animation_name: String
|
||||
|
||||
# Public Methods
|
||||
func GetAnimationBaseName() -> String:
|
||||
return "idle"
|
||||
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.PLAY_ANIMATION
|
||||
|
||||
|
||||
func Enter(_extra_parameters: Dictionary) -> void:
|
||||
current_animation_name = _extra_parameters["animation_name"]
|
||||
print("Playing Player Animation State: [%s]" % current_animation_name)
|
||||
PlayAnimation.emit(current_animation_name)
|
||||
|
||||
|
||||
func Exit() -> void:
|
||||
current_animation_name = ''
|
||||
|
||||
|
||||
func OnAnimationFinished(animation_name: String) -> void:
|
||||
if animation_name != current_animation_name: return
|
||||
AnimationFinished.emit(animation_name)
|
||||
@@ -0,0 +1 @@
|
||||
uid://wfdtd3xlgrvm
|
||||
25
Entities/Characters/Player/Scripts/States/sitting_state.gd
Normal file
25
Entities/Characters/Player/Scripts/States/sitting_state.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
extends BaseState
|
||||
|
||||
@onready var player: PlayerCharacter = $"../../.."
|
||||
@onready var facing_direction_component: FacingDirectionComponent = $"../../../Components/FacingDirectionComponent"
|
||||
|
||||
func GetAnimationBaseName() -> String:
|
||||
return "idle"
|
||||
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.SITTING
|
||||
|
||||
|
||||
func Enter(extra_parameters: Dictionary) -> void:
|
||||
var pos := extra_parameters["pos"] as Vector2
|
||||
var dir := extra_parameters["dir"] as Enums.Directions
|
||||
|
||||
player.position = pos
|
||||
facing_direction_component.SetDirectionManually(dir)
|
||||
|
||||
|
||||
func Update(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("player_interact"):
|
||||
player.position = Vector2(player.position.x, player.position.y + 16)
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bx1a35al4yiej
|
||||
@@ -0,0 +1,15 @@
|
||||
extends BaseState
|
||||
|
||||
@export var body: CharacterBody2D
|
||||
@export var direction_component: FacingDirectionComponent
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.USING_ITEM_A
|
||||
|
||||
|
||||
func GetAnimationBaseName() -> String:
|
||||
return "idle"
|
||||
|
||||
|
||||
func Update(_delta: float) -> void:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.DRAWING_BOW, { "action_name": "use_item_a" })
|
||||
@@ -0,0 +1 @@
|
||||
uid://ckn7gmtc23b8l
|
||||
27
Entities/Characters/Player/Scripts/States/walking_state.gd
Normal file
27
Entities/Characters/Player/Scripts/States/walking_state.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends BaseState
|
||||
|
||||
signal StartedWalking
|
||||
|
||||
@export var walking_speed := 100
|
||||
@export var movement_component: MovementComponent
|
||||
@export var direction_component: FacingDirectionComponent
|
||||
@export var body: CharacterBody2D
|
||||
|
||||
func GetStateEnum() -> PlayerStateMachine.States:
|
||||
return PlayerStateMachine.States.WALKING
|
||||
|
||||
|
||||
func Enter(_extra_parameters: Dictionary) -> void:
|
||||
StartedWalking.emit()
|
||||
|
||||
|
||||
func Update(_delta: float) -> void:
|
||||
if movement_component.movement_vector == Vector2.ZERO:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
|
||||
return
|
||||
|
||||
var movement_vector := movement_component.movement_vector
|
||||
body.velocity = movement_vector * walking_speed
|
||||
body.move_and_slide()
|
||||
|
||||
direction_component.ChangeDirectionUsingMovementVector(movement_vector)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bwmmah30t3m0u
|
||||
28
Entities/Characters/Player/Scripts/interact_scanner.gd
Normal file
28
Entities/Characters/Player/Scripts/interact_scanner.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Area2D
|
||||
class_name InteractScanner
|
||||
|
||||
signal InteractionActionTriggered()
|
||||
|
||||
@export var parent: Node2D
|
||||
@export var direction_component: FacingDirectionComponent
|
||||
@export var disable_interactions := false
|
||||
|
||||
# Public Methods
|
||||
func OnDirectionChanged() -> void:
|
||||
var direction := direction_component.GetCurrentDirection()
|
||||
if direction == Enums.Directions.LEFT:
|
||||
parent.rotation = deg_to_rad(90)
|
||||
elif direction == Enums.Directions.RIGHT:
|
||||
parent.rotation = deg_to_rad(-90)
|
||||
elif direction == Enums.Directions.UP:
|
||||
parent.rotation = deg_to_rad(180)
|
||||
else:
|
||||
parent.rotation = deg_to_rad(0)
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if disable_interactions:
|
||||
return
|
||||
if Input.is_action_just_pressed("player_interact"):
|
||||
InputManager.IgnoreAction("player_interact")
|
||||
InteractionActionTriggered.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://brlisuoocwehh
|
||||
18
Entities/Characters/Player/Scripts/movement_component.gd
Normal file
18
Entities/Characters/Player/Scripts/movement_component.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends Node
|
||||
class_name MovementComponent
|
||||
|
||||
signal MovementInput(movement_vector: Vector2)
|
||||
|
||||
# Dynamic Exports
|
||||
@export var body: CharacterBody2D
|
||||
|
||||
var movement_vector: Vector2
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
var direction_vector := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
|
||||
|
||||
if direction_vector:
|
||||
movement_vector = direction_vector
|
||||
MovementInput.emit(movement_vector)
|
||||
else:
|
||||
movement_vector = Vector2.ZERO
|
||||
@@ -0,0 +1 @@
|
||||
uid://dwclkwbig1uii
|
||||
18
Entities/Characters/Player/Scripts/player.gd
Normal file
18
Entities/Characters/Player/Scripts/player.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends CharacterBody2D
|
||||
class_name PlayerCharacter
|
||||
|
||||
# Signals
|
||||
signal SitOnFurnitureTriggered(sitting_position: Vector2, sitting_direction: Enums.Directions)
|
||||
|
||||
# Exports
|
||||
@export var player_sprite: PlayerSprite
|
||||
@export var state_machine: PlayerStateMachine
|
||||
@export var interact_scanner: InteractScanner
|
||||
|
||||
# Public Methods
|
||||
func QueueCutsceneState() -> void:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.CUTSCENE)
|
||||
|
||||
|
||||
func QueueEndCutsceneState() -> void:
|
||||
state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
|
||||
1
Entities/Characters/Player/Scripts/player.gd.uid
Normal file
1
Entities/Characters/Player/Scripts/player.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dacvayqstkvws
|
||||
78
Entities/Characters/Player/Scripts/sprite.gd
Normal file
78
Entities/Characters/Player/Scripts/sprite.gd
Normal file
@@ -0,0 +1,78 @@
|
||||
extends Node2D
|
||||
class_name PlayerSprite
|
||||
|
||||
# Signals
|
||||
signal DrawingBowAnimationFinished
|
||||
signal FiringArrowAnimationFinished
|
||||
signal AnimationFinished(animation_name: String)
|
||||
|
||||
# Exports
|
||||
@export var state_machine: PlayerStateMachine
|
||||
@export var direction_component: FacingDirectionComponent
|
||||
|
||||
# OnReady Variables
|
||||
@onready var full: AnimatedSprite2D = $Full
|
||||
|
||||
# Private Variables
|
||||
var _all_parts: Array[AnimatedSprite2D]
|
||||
var _current_animation := "idle-down"
|
||||
var _is_flipped := false
|
||||
|
||||
# Public Methods
|
||||
func UpdateSprite() -> void:
|
||||
var current_state := state_machine.current_state
|
||||
var current_direction := direction_component.GetCurrentDirection()
|
||||
var animation := _build_animation_name(current_state, current_direction)
|
||||
var should_flip := _should_flip_horizontal()
|
||||
|
||||
if animation == _current_animation and should_flip == _is_flipped:
|
||||
return
|
||||
|
||||
_current_animation = animation
|
||||
_is_flipped = should_flip
|
||||
|
||||
for part in _all_parts:
|
||||
part.animation = animation
|
||||
part.play()
|
||||
part.flip_h = should_flip
|
||||
|
||||
|
||||
func OnAnimationFinished() -> void:
|
||||
if _current_animation.begins_with("drawing-bow-"):
|
||||
DrawingBowAnimationFinished.emit()
|
||||
elif _current_animation.begins_with("firing-arrow-"):
|
||||
FiringArrowAnimationFinished.emit()
|
||||
AnimationFinished.emit(_current_animation)
|
||||
|
||||
|
||||
func PlaySpecifiedAnimation(animation_name: String) -> void:
|
||||
_current_animation = animation_name
|
||||
for part in _all_parts:
|
||||
part.animation = animation_name
|
||||
part.play()
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
_all_parts = [
|
||||
full
|
||||
]
|
||||
|
||||
UpdateSprite()
|
||||
|
||||
|
||||
func _build_animation_name(state: BaseState, direction: Enums.Directions) -> String:
|
||||
# e.g. "idle-down", "walking-up"
|
||||
var state_str := state.GetAnimationBaseName().replace("_", "-")
|
||||
var direction_str := _direction_to_animation_state(direction)
|
||||
return "%s-%s" % [state_str, direction_str]
|
||||
|
||||
|
||||
func _direction_to_animation_state(direction: Enums.Directions) -> String:
|
||||
if direction == Enums.Directions.LEFT or direction == Enums.Directions.RIGHT:
|
||||
return "side"
|
||||
return Enums.Directions.keys()[direction].to_lower()
|
||||
|
||||
|
||||
func _should_flip_horizontal() -> bool:
|
||||
return direction_component.GetCurrentDirection() == Enums.Directions.LEFT
|
||||
1
Entities/Characters/Player/Scripts/sprite.gd.uid
Normal file
1
Entities/Characters/Player/Scripts/sprite.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cuar23q48cbja
|
||||
58
Entities/Characters/Player/Scripts/state_machine.gd
Normal file
58
Entities/Characters/Player/Scripts/state_machine.gd
Normal file
@@ -0,0 +1,58 @@
|
||||
extends Node
|
||||
class_name PlayerStateMachine
|
||||
|
||||
signal StateChanged
|
||||
|
||||
enum States {
|
||||
UNSET, IDLE, WALKING, USING_ITEM_A, DRAWING_BOW, FIRING_ARROW,
|
||||
SITTING, CUTSCENE, PLAY_ANIMATION
|
||||
}
|
||||
|
||||
@export var states_container: Node
|
||||
@export var current_state: BaseState
|
||||
|
||||
var state_dict := {}
|
||||
var queued_state: PlayerStateMachine.States = PlayerStateMachine.States.UNSET
|
||||
var queued_parameters: Dictionary = {}
|
||||
|
||||
# Public Methods
|
||||
func GetCurrentStateEnum() -> States:
|
||||
return current_state.GetStateEnum()
|
||||
|
||||
|
||||
func QueueStateChange(to_state_enum: PlayerStateMachine.States, extra_parameters: Dictionary = {}) -> void:
|
||||
queued_state = to_state_enum
|
||||
queued_parameters = extra_parameters
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
var children := states_container.get_children()
|
||||
for child in children:
|
||||
if child is not BaseState:
|
||||
continue
|
||||
var state := child as BaseState
|
||||
state_dict[state.GetStateEnum()] = state
|
||||
|
||||
if current_state:
|
||||
current_state.Enter({})
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if current_state:
|
||||
current_state.Update(delta)
|
||||
|
||||
if queued_state != PlayerStateMachine.States.UNSET:
|
||||
_swap_state()
|
||||
|
||||
|
||||
func _swap_state() -> void:
|
||||
if current_state:
|
||||
current_state.Exit()
|
||||
|
||||
current_state = state_dict[queued_state] as BaseState
|
||||
current_state.Enter(queued_parameters)
|
||||
queued_state = PlayerStateMachine.States.UNSET
|
||||
queued_parameters = {}
|
||||
|
||||
StateChanged.emit()
|
||||
1
Entities/Characters/Player/Scripts/state_machine.gd.uid
Normal file
1
Entities/Characters/Player/Scripts/state_machine.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c74mhfemxuuco
|
||||
135
Entities/Characters/Player/player.tscn
Normal file
135
Entities/Characters/Player/player.tscn
Normal file
@@ -0,0 +1,135 @@
|
||||
[gd_scene format=3 uid="uid://6athlweutl2g"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://uyl0s1e67x6s" path="res://Entities/Characters/Player/sprite.tscn" id="1_27cb7"]
|
||||
[ext_resource type="PackedScene" uid="uid://c2ydbmmvnfca6" path="res://Entities/Characters/Player/state_machine.tscn" id="1_lyjr2"]
|
||||
[ext_resource type="Script" uid="uid://dacvayqstkvws" path="res://Entities/Characters/Player/Scripts/player.gd" id="1_qqvsf"]
|
||||
[ext_resource type="Script" uid="uid://b0l02v61if6k8" path="res://Scripts/Components/facing_direction_component.gd" id="1_siygm"]
|
||||
[ext_resource type="Script" uid="uid://dwclkwbig1uii" path="res://Entities/Characters/Player/Scripts/movement_component.gd" id="4_apx8m"]
|
||||
[ext_resource type="Script" uid="uid://dkmc1t43gomdb" path="res://Entities/Characters/Player/Scripts/States/idle_state.gd" id="4_dxcao"]
|
||||
[ext_resource type="Script" uid="uid://ckn7gmtc23b8l" path="res://Entities/Characters/Player/Scripts/States/using_item_a_state.gd" id="5_1mdwi"]
|
||||
[ext_resource type="Script" uid="uid://bwmmah30t3m0u" path="res://Entities/Characters/Player/Scripts/States/walking_state.gd" id="5_cscr0"]
|
||||
[ext_resource type="Script" uid="uid://brlisuoocwehh" path="res://Entities/Characters/Player/Scripts/interact_scanner.gd" id="6_fu1fx"]
|
||||
[ext_resource type="Script" uid="uid://bnp1vowmu15lg" path="res://Entities/Characters/Player/Scripts/States/drawing_bow_state.gd" id="7_cscr0"]
|
||||
[ext_resource type="Script" uid="uid://cd2ewadcm8oi5" path="res://Entities/Characters/Player/Scripts/States/firing_arrow_state.gd" id="8_plevq"]
|
||||
[ext_resource type="Script" uid="uid://bx1a35al4yiej" path="res://Entities/Characters/Player/Scripts/States/sitting_state.gd" id="9_sdxbo"]
|
||||
[ext_resource type="Script" uid="uid://bnontuqj3cnom" path="res://Entities/Characters/Player/Scripts/States/cutscene_state.gd" id="10_p06rw"]
|
||||
[ext_resource type="Script" uid="uid://wfdtd3xlgrvm" path="res://Entities/Characters/Player/Scripts/States/play_animation_state.gd" id="12_aencf"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_apx8m"]
|
||||
size = Vector2(10, 5)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_plevq"]
|
||||
radius = 12.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fu1fx"]
|
||||
size = Vector2(6, 5)
|
||||
|
||||
[node name="Player" type="CharacterBody2D" unique_id=1502234578 node_paths=PackedStringArray("player_sprite", "state_machine", "interact_scanner") groups=["Player Group"]]
|
||||
y_sort_enabled = true
|
||||
script = ExtResource("1_qqvsf")
|
||||
player_sprite = NodePath("Player Sprite")
|
||||
state_machine = NodePath("State Machine")
|
||||
interact_scanner = NodePath("Marker2D/InteractScanner")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=495465356]
|
||||
position = Vector2(0, 4.5)
|
||||
shape = SubResource("RectangleShape2D_apx8m")
|
||||
|
||||
[node name="Components" type="Node" parent="." unique_id=567893784]
|
||||
|
||||
[node name="FacingDirectionComponent" type="Node" parent="Components" unique_id=408127032]
|
||||
script = ExtResource("1_siygm")
|
||||
|
||||
[node name="MovementComponent" type="Node" parent="Components" unique_id=1773880772 node_paths=PackedStringArray("body")]
|
||||
script = ExtResource("4_apx8m")
|
||||
body = NodePath("../..")
|
||||
|
||||
[node name="State Machine" parent="." unique_id=732559774 node_paths=PackedStringArray("states_container", "current_state") instance=ExtResource("1_lyjr2")]
|
||||
states_container = NodePath("States")
|
||||
current_state = NodePath("States/Idle State")
|
||||
|
||||
[node name="States" type="Node" parent="State Machine" unique_id=1171587216]
|
||||
|
||||
[node name="Idle State" type="Node" parent="State Machine/States" unique_id=2017409248 node_paths=PackedStringArray("movement_component", "state_machine")]
|
||||
script = ExtResource("4_dxcao")
|
||||
movement_component = NodePath("../../../Components/MovementComponent")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Walking State" type="Node" parent="State Machine/States" unique_id=1661048365 node_paths=PackedStringArray("movement_component", "direction_component", "body", "state_machine")]
|
||||
script = ExtResource("5_cscr0")
|
||||
movement_component = NodePath("../../../Components/MovementComponent")
|
||||
direction_component = NodePath("../../../Components/FacingDirectionComponent")
|
||||
body = NodePath("../../..")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Using Item A State" type="Node" parent="State Machine/States" unique_id=1017153142 node_paths=PackedStringArray("body", "direction_component", "state_machine")]
|
||||
script = ExtResource("5_1mdwi")
|
||||
body = NodePath("../../..")
|
||||
direction_component = NodePath("../../../Components/FacingDirectionComponent")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Drawing Bow State" type="Node" parent="State Machine/States" unique_id=317681716 node_paths=PackedStringArray("movement_componenent", "body", "state_machine")]
|
||||
script = ExtResource("7_cscr0")
|
||||
movement_componenent = NodePath("../../../Components/MovementComponent")
|
||||
body = NodePath("../../..")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Firing Arrow State" type="Node" parent="State Machine/States" unique_id=2129772816 node_paths=PackedStringArray("direction_component", "arrow_spawn_marker", "state_machine")]
|
||||
script = ExtResource("8_plevq")
|
||||
direction_component = NodePath("../../../Components/FacingDirectionComponent")
|
||||
arrow_spawn_marker = NodePath("../../../Marker2D")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Sitting State" type="Node" parent="State Machine/States" unique_id=1774602333 node_paths=PackedStringArray("state_machine")]
|
||||
script = ExtResource("9_sdxbo")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Cutscene State" type="Node" parent="State Machine/States" unique_id=1722986400 node_paths=PackedStringArray("state_machine")]
|
||||
script = ExtResource("10_p06rw")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Play Animation State" type="Node" parent="State Machine/States" unique_id=1357816619 node_paths=PackedStringArray("state_machine")]
|
||||
script = ExtResource("12_aencf")
|
||||
state_machine = NodePath("../..")
|
||||
|
||||
[node name="Occlusion Culling Area" type="Area2D" parent="." unique_id=1195961806]
|
||||
collision_layer = 8
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culling Area" unique_id=1162272029]
|
||||
shape = SubResource("CircleShape2D_plevq")
|
||||
|
||||
[node name="Player Sprite" parent="." unique_id=1169131604 node_paths=PackedStringArray("state_machine", "direction_component") instance=ExtResource("1_27cb7")]
|
||||
state_machine = NodePath("../State Machine")
|
||||
direction_component = NodePath("../Components/FacingDirectionComponent")
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="." unique_id=2003544808]
|
||||
|
||||
[node name="InteractScanner" type="Area2D" parent="Marker2D" unique_id=408353807 node_paths=PackedStringArray("parent", "direction_component")]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
script = ExtResource("6_fu1fx")
|
||||
parent = NodePath("..")
|
||||
direction_component = NodePath("../../Components/FacingDirectionComponent")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Marker2D/InteractScanner" unique_id=1274307485]
|
||||
position = Vector2(0, 9.5)
|
||||
shape = SubResource("RectangleShape2D_fu1fx")
|
||||
debug_color = Color(0.79959095, 0.41617078, 0.18507844, 0.41960785)
|
||||
|
||||
[connection signal="SitOnFurnitureTriggered" from="." to="State Machine/States/Idle State" method="OnSitOnFurnitureTriggered"]
|
||||
[connection signal="DirectionChanged" from="Components/FacingDirectionComponent" to="Player Sprite" method="UpdateSprite"]
|
||||
[connection signal="DirectionChanged" from="Components/FacingDirectionComponent" to="Marker2D/InteractScanner" method="OnDirectionChanged"]
|
||||
[connection signal="PlayerBecameIdle" from="State Machine/States/Idle State" to="Player Sprite" method="UpdateSprite"]
|
||||
[connection signal="StartedWalking" from="State Machine/States/Walking State" to="Player Sprite" method="UpdateSprite"]
|
||||
[connection signal="PlayerBeganDrawingBow" from="State Machine/States/Drawing Bow State" to="Player Sprite" method="UpdateSprite"]
|
||||
[connection signal="PlayerBeganFiringArrow" from="State Machine/States/Firing Arrow State" to="Player Sprite" method="UpdateSprite"]
|
||||
[connection signal="PlayAnimation" from="State Machine/States/Play Animation State" to="Player Sprite" method="PlaySpecifiedAnimation"]
|
||||
[connection signal="AnimationFinished" from="Player Sprite" to="State Machine/States/Play Animation State" method="OnAnimationFinished"]
|
||||
[connection signal="DrawingBowAnimationFinished" from="Player Sprite" to="State Machine/States/Drawing Bow State" method="OnDrawingBowAnimationFinished"]
|
||||
[connection signal="FiringArrowAnimationFinished" from="Player Sprite" to="State Machine/States/Firing Arrow State" method="OnFiringArrowAnimationFinished"]
|
||||
[connection signal="InteractionActionTriggered" from="Marker2D/InteractScanner" to="." method="_on_interaction_action_triggered"]
|
||||
[connection signal="area_entered" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_area_entered"]
|
||||
[connection signal="area_exited" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_area_exited"]
|
||||
[connection signal="body_entered" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_body_entered"]
|
||||
[connection signal="body_exited" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_body_exited"]
|
||||
40
Entities/Characters/Player/player_bow_sprite.tscn
Normal file
40
Entities/Characters/Player/player_bow_sprite.tscn
Normal file
@@ -0,0 +1,40 @@
|
||||
[gd_scene format=3 uid="uid://cbog2vcpvg734"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dxycty45yvcdq" path="res://Assets/Spritesheets/Player/Tools/Wooden_Bow.png" id="1_b6p0h"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yka8g"]
|
||||
atlas = ExtResource("1_b6p0h")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8vxy0"]
|
||||
atlas = ExtResource("1_b6p0h")
|
||||
region = Rect2(64, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_26j7r"]
|
||||
atlas = ExtResource("1_b6p0h")
|
||||
region = Rect2(128, 0, 64, 64)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_a2gi6"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_yka8g")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8vxy0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_26j7r")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"draw-bow-down",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="Player Bow Sprite" type="Node2D" unique_id=1297275413]
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1622645109]
|
||||
sprite_frames = SubResource("SpriteFrames_a2gi6")
|
||||
animation = &"draw-bow-down"
|
||||
frame = 2
|
||||
frame_progress = 1.0
|
||||
1756
Entities/Characters/Player/sprite.tscn
Normal file
1756
Entities/Characters/Player/sprite.tscn
Normal file
File diff suppressed because it is too large
Load Diff
6
Entities/Characters/Player/state_machine.tscn
Normal file
6
Entities/Characters/Player/state_machine.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://c2ydbmmvnfca6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c74mhfemxuuco" path="res://Entities/Characters/Player/Scripts/state_machine.gd" id="1_clu2m"]
|
||||
|
||||
[node name="StateMachine" type="Node" unique_id=732559774]
|
||||
script = ExtResource("1_clu2m")
|
||||
@@ -0,0 +1,15 @@
|
||||
extends Area2D
|
||||
|
||||
@export var to_alpha := 0.38
|
||||
@export var fade_out_duration := 0.2
|
||||
@export var fade_in_duration := 0.2
|
||||
@export var nodes_to_occlude: Array[Node2D]
|
||||
|
||||
func _on_area_entered(_area: Area2D) -> void:
|
||||
for node in nodes_to_occlude:
|
||||
get_tree().create_tween().tween_property(node, "self_modulate:a", to_alpha, fade_out_duration)
|
||||
|
||||
|
||||
func _on_area_exited(_area: Area2D) -> void:
|
||||
for node in nodes_to_occlude:
|
||||
get_tree().create_tween().tween_property(node, "self_modulate:a", 1.0, fade_in_duration)
|
||||
@@ -0,0 +1 @@
|
||||
uid://ba0nsd76er3xa
|
||||
11
Entities/Characters/Utility/Occlusion/occlusion_culler.tscn
Normal file
11
Entities/Characters/Utility/Occlusion/occlusion_culler.tscn
Normal file
@@ -0,0 +1,11 @@
|
||||
[gd_scene format=3 uid="uid://d24gcv3umq60k"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ba0nsd76er3xa" path="res://Entities/Characters/Utility/Occlusion/Scripts/occlusion_culler.gd" id="1_4550i"]
|
||||
|
||||
[node name="Occlusion Culler" type="Area2D" unique_id=1362480066]
|
||||
collision_layer = 0
|
||||
collision_mask = 8
|
||||
script = ExtResource("1_4550i")
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="area_exited" from="." to="." method="_on_area_exited"]
|
||||
9
Entities/Map Objects/Chests/Bases/base_chest.tscn
Normal file
9
Entities/Map Objects/Chests/Bases/base_chest.tscn
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://cd3iyspcdg8m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0fsmtp1umvmp" path="res://Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd" id="1_6u2sl"]
|
||||
|
||||
[node name="Base Chest" type="StaticBody2D" unique_id=975880832 groups=["Treasure Chest Group"]]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_6u2sl")
|
||||
7
Entities/Map Objects/Chests/Bases/base_item_chest.tscn
Normal file
7
Entities/Map Objects/Chests/Bases/base_item_chest.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://cncm0c4dmosgs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dbuc0f87m24xf" path="res://Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd" id="1_mkt0u"]
|
||||
|
||||
[node name="Base Item Chest" type="StaticBody2D" unique_id=991903258]
|
||||
script = ExtResource("1_mkt0u")
|
||||
metadata/_custom_type_script = "uid://0fsmtp1umvmp"
|
||||
@@ -0,0 +1,105 @@
|
||||
[gd_scene format=3 uid="uid://byp273amg5ji8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Entities/Map Objects/Chests/Scripts/item_chest_01.gd" id="1_lp0kr"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn" id="2_iwcc8"]
|
||||
[ext_resource type="Texture2D" uid="uid://crf23tc55dxu" path="res://Assets/Spritesheets/Treasure Chests/Chest_Anim.png" id="3_iwcc8"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3ooa"]
|
||||
size = Vector2(16, 6)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5bus"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8m6gq"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2vpuu"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydixn"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wetyp"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hwpw4"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_clx0v"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t1w70"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_0r744"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b5bus")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8m6gq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2vpuu")
|
||||
}, {
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_ydixn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wetyp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hwpw4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_clx0v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t1w70")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t6vq7"]
|
||||
size = Vector2(8, 9)
|
||||
|
||||
[node name="Item Chest 01" type="StaticBody2D" unique_id=152271802 groups=["Treasure Chest Group"]]
|
||||
script = ExtResource("1_lp0kr")
|
||||
metadata/_custom_type_script = "uid://dbuc0f87m24xf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=192723247]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("RectangleShape2D_y3ooa")
|
||||
|
||||
[node name="Sprite" parent="." unique_id=1811986888 instance=ExtResource("2_iwcc8")]
|
||||
sprite_frames = SubResource("SpriteFrames_0r744")
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=406451066]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=124862139]
|
||||
position = Vector2(0, -9.5)
|
||||
shape = SubResource("RectangleShape2D_t6vq7")
|
||||
debug_color = Color(0.8351757, 0.36057177, 0.39313078, 0.41960785)
|
||||
@@ -0,0 +1,106 @@
|
||||
[gd_scene format=3 uid="uid://b7u4hlvuqiefn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Entities/Map Objects/Chests/Scripts/item_chest_01.gd" id="1_77oue"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn" id="2_jpeii"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcbk854sc3uud" path="res://Assets/Spritesheets/Home Decor/Metal_Chest_Anim.png" id="3_jpeii"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3ooa"]
|
||||
size = Vector2(16, 6)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1k0b3"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydgix"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s4uuj"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f64hp"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xb452"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mmcbf"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p1iln"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wsmdh"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_2qcbe"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1k0b3")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ydgix")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s4uuj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_f64hp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xb452")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mmcbf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_p1iln")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wsmdh")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t6vq7"]
|
||||
size = Vector2(8, 9)
|
||||
|
||||
[node name="Item Chest 02" type="StaticBody2D" unique_id=152271802 groups=["Treasure Chest Group"]]
|
||||
script = ExtResource("1_77oue")
|
||||
metadata/_custom_type_script = "uid://dbuc0f87m24xf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=192723247]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("RectangleShape2D_y3ooa")
|
||||
|
||||
[node name="Sprite" parent="." unique_id=1811986888 instance=ExtResource("2_jpeii")]
|
||||
sprite_frames = SubResource("SpriteFrames_2qcbe")
|
||||
animation = &"opening"
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=406451066]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=124862139]
|
||||
position = Vector2(0, -9.5)
|
||||
shape = SubResource("RectangleShape2D_t6vq7")
|
||||
debug_color = Color(0.8351757, 0.36057177, 0.39313078, 0.41960785)
|
||||
14
Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd
Normal file
14
Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends StaticBody2D
|
||||
class_name BaseChest
|
||||
|
||||
signal OpeningAnimationStarted
|
||||
|
||||
@export var is_open := false
|
||||
|
||||
# Public Methods
|
||||
func Open() -> void:
|
||||
is_open = true
|
||||
|
||||
|
||||
func OpenAlreadyOpened() -> void:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://0fsmtp1umvmp
|
||||
4
Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd
Normal file
4
Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd
Normal file
@@ -0,0 +1,4 @@
|
||||
extends BaseChest
|
||||
class_name BaseItemChest
|
||||
|
||||
@export var item_id: Enums.Items
|
||||
@@ -0,0 +1 @@
|
||||
uid://dbuc0f87m24xf
|
||||
33
Entities/Map Objects/Chests/Scripts/item_chest_01.gd
Normal file
33
Entities/Map Objects/Chests/Scripts/item_chest_01.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
extends BaseItemChest
|
||||
|
||||
@onready var chest_01_sprite: AnimatedSprite2D = $"Sprite"
|
||||
|
||||
@export var is_locked := false
|
||||
@export var locked_message_dialogue_trigger: DialogueTrigger
|
||||
@export var already_opened_message_dialogue_trigger: DialogueTrigger
|
||||
|
||||
# Public Methods
|
||||
func Open() -> void:
|
||||
if is_locked:
|
||||
if locked_message_dialogue_trigger:
|
||||
locked_message_dialogue_trigger.Trigger()
|
||||
return
|
||||
|
||||
super.Open()
|
||||
|
||||
OpeningAnimationStarted.emit()
|
||||
chest_01_sprite.play("opening")
|
||||
|
||||
var item_name: String = Enums.Items.keys()[item_id]
|
||||
print(item_name)
|
||||
|
||||
|
||||
func OpenAlreadyOpened() -> void:
|
||||
if already_opened_message_dialogue_trigger:
|
||||
already_opened_message_dialogue_trigger.Trigger()
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
if is_open:
|
||||
chest_01_sprite.play("opened")
|
||||
1
Entities/Map Objects/Chests/Scripts/item_chest_01.gd.uid
Normal file
1
Entities/Map Objects/Chests/Scripts/item_chest_01.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bvq13h8uyx572
|
||||
84
Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn
Normal file
84
Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn
Normal file
@@ -0,0 +1,84 @@
|
||||
[gd_scene format=3 uid="uid://d3rqn611axsfk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://crf23tc55dxu" path="res://Assets/Spritesheets/Treasure Chests/Chest_Anim.png" id="1_8m6gq"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5bus"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8m6gq"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2vpuu"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydixn"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wetyp"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hwpw4"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_clx0v"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t1w70"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_sx0xc"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b5bus")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8m6gq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2vpuu")
|
||||
}, {
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_ydixn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wetyp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hwpw4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_clx0v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t1w70")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="Chest01 Sprite" type="AnimatedSprite2D" unique_id=1811986888]
|
||||
y_sort_enabled = true
|
||||
sprite_frames = SubResource("SpriteFrames_sx0xc")
|
||||
animation = &"closed"
|
||||
autoplay = "closed"
|
||||
offset = Vector2(0, -6)
|
||||
@@ -0,0 +1,2 @@
|
||||
extends StaticBody2D
|
||||
class_name WoodenBench
|
||||
@@ -0,0 +1 @@
|
||||
uid://c6n652dy18xbm
|
||||
48
Entities/Map Objects/Decorative/Outdoor/wooden_bench.tscn
Normal file
48
Entities/Map Objects/Decorative/Outdoor/wooden_bench.tscn
Normal file
@@ -0,0 +1,48 @@
|
||||
[gd_scene format=3 uid="uid://23tpba4r6ucg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://nocnsf1xr3ap" path="res://Assets/Spritesheets/Outdoor Decor/Benches.png" id="1_jlu4v"]
|
||||
[ext_resource type="Script" uid="uid://c6n652dy18xbm" path="res://Entities/Map Objects/Decorative/Outdoor/Scripts/wooden_bench.gd" id="1_nv27i"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nv27i"]
|
||||
size = Vector2(30, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ffqsr"]
|
||||
atlas = ExtResource("1_jlu4v")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jlu4v"]
|
||||
size = Vector2(30, 8)
|
||||
|
||||
[node name="Wooden Bench" type="StaticBody2D" unique_id=134763703]
|
||||
y_sort_enabled = true
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_nv27i")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1606779105]
|
||||
position = Vector2(0, 3.5)
|
||||
shape = SubResource("RectangleShape2D_nv27i")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=277583581]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 5)
|
||||
texture = SubResource("AtlasTexture_ffqsr")
|
||||
offset = Vector2(0, -5)
|
||||
|
||||
[node name="Sitting Spots" type="Node2D" parent="." unique_id=1579486993]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Sitting Spots" unique_id=1705252915]
|
||||
position = Vector2(-9, 0)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Sitting Spots" unique_id=1990058096]
|
||||
position = Vector2(9, 0)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Sitting Spots" unique_id=1451254051]
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=1791036565]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=1358423659]
|
||||
position = Vector2(0, 2)
|
||||
shape = SubResource("RectangleShape2D_jlu4v")
|
||||
debug_color = Color(0.991744, 0, 0.26762646, 0.41960785)
|
||||
23
Entities/Map Objects/Decorative/Signs/wooden_sign_01.tscn
Normal file
23
Entities/Map Objects/Decorative/Signs/wooden_sign_01.tscn
Normal file
@@ -0,0 +1,23 @@
|
||||
[gd_scene format=3 uid="uid://dwbg6wca6yl5j"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://fsdihflna5x8" path="res://Assets/Spritesheets/Outdoor Decor/Signs.png" id="1_i0umk"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_mo7c5"]
|
||||
radius = 4.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3a56g"]
|
||||
atlas = ExtResource("1_i0umk")
|
||||
region = Rect2(0, 144, 32, 48)
|
||||
|
||||
[node name="Wooden Sign 01" type="StaticBody2D" unique_id=940755730]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1879872203]
|
||||
position = Vector2(7, 20)
|
||||
shape = SubResource("CircleShape2D_mo7c5")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=824773966]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 22)
|
||||
texture = SubResource("AtlasTexture_3a56g")
|
||||
offset = Vector2(0, -22)
|
||||
24
Entities/Map Objects/Decorative/Signs/wooden_sign_02.tscn
Normal file
24
Entities/Map Objects/Decorative/Signs/wooden_sign_02.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene format=3 uid="uid://coaf2ndwb6h61"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://fsdihflna5x8" path="res://Assets/Spritesheets/Outdoor Decor/Signs.png" id="1_7fm5q"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7fm5q"]
|
||||
size = Vector2(4, 4)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_83w4c"]
|
||||
atlas = ExtResource("1_7fm5q")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[node name="Wooden Sign 02" type="StaticBody2D" unique_id=1825670645]
|
||||
y_sort_enabled = true
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1251542595]
|
||||
position = Vector2(0, 5)
|
||||
shape = SubResource("RectangleShape2D_7fm5q")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=679110181]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 7)
|
||||
texture = SubResource("AtlasTexture_83w4c")
|
||||
offset = Vector2(0, -7)
|
||||
10
Entities/Map Objects/Dialogue/Scripts/dialogue_trigger.gd
Normal file
10
Entities/Map Objects/Dialogue/Scripts/dialogue_trigger.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Area2D
|
||||
class_name DialogueTrigger
|
||||
|
||||
signal DialogueTriggered(dialogue_name: String)
|
||||
|
||||
@export var dialogue_name: String
|
||||
|
||||
# Public Methods
|
||||
func Trigger() -> void:
|
||||
DialogueTriggered.emit(dialogue_name)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cfsfx0sahh5t7
|
||||
8
Entities/Map Objects/Dialogue/dialogue_trigger.tscn
Normal file
8
Entities/Map Objects/Dialogue/dialogue_trigger.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://b60nr4wfvijpf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cfsfx0sahh5t7" path="res://Entities/Map Objects/Dialogue/Scripts/dialogue_trigger.gd" id="1_dyjvr"]
|
||||
|
||||
[node name="Dialogue Trigger" type="Area2D" unique_id=189867444 groups=["Dialog Trigger Group"]]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_dyjvr")
|
||||
22
Entities/Map Objects/Entity Spawners/arrow_spawner.gd
Normal file
22
Entities/Map Objects/Entity Spawners/arrow_spawner.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends Node
|
||||
|
||||
# Exports
|
||||
@export var player: PlayerCharacter
|
||||
@export var arrow_parent: Node2D
|
||||
|
||||
# Preloads
|
||||
const wooden_arrow_scene: PackedScene = preload("uid://b2wq5m01b68rx")
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
var firing_arrow_state: FiringArrowState = player.get_node("State Machine/States/Firing Arrow State")
|
||||
firing_arrow_state.ArrowFired.connect(_on_arrow_fired)
|
||||
|
||||
|
||||
func _on_arrow_fired(fire_position: Vector2, direction: Vector2) -> void:
|
||||
var wooden_arrow := wooden_arrow_scene.instantiate() as BaseProjectile
|
||||
wooden_arrow.SetProjectileStartAndDirection(fire_position, direction)
|
||||
|
||||
if arrow_parent == null:
|
||||
return
|
||||
arrow_parent.add_child(wooden_arrow)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dvgd5ejerauqm
|
||||
17
Entities/Map Objects/Gates/Spike Gate/Scripts/spike_gate.gd
Normal file
17
Entities/Map Objects/Gates/Spike Gate/Scripts/spike_gate.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends StaticBody2D
|
||||
|
||||
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||
@onready var collision_shape_2d: CollisionShape2D = $CollisionShape2D
|
||||
|
||||
var is_open := false
|
||||
|
||||
func OpenGate() -> void:
|
||||
if is_open:
|
||||
return
|
||||
is_open = true
|
||||
|
||||
sprite.play("opening")
|
||||
await sprite.animation_finished
|
||||
|
||||
collision_shape_2d.set_deferred("disabled", true)
|
||||
sprite.play("open")
|
||||
@@ -0,0 +1 @@
|
||||
uid://8erg53skow38
|
||||
400
Entities/Map Objects/Gates/Spike Gate/spike_gate.tscn
Normal file
400
Entities/Map Objects/Gates/Spike Gate/spike_gate.tscn
Normal file
@@ -0,0 +1,400 @@
|
||||
[gd_scene format=3 uid="uid://da4qqruhldc6b"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://1kmd0qww3368" path="res://Assets/Spritesheets/Outdoor Objects/Spike_Gate_anim.png" id="1_5ttkm"]
|
||||
[ext_resource type="Script" uid="uid://8erg53skow38" path="res://Entities/Map Objects/Gates/Spike Gate/Scripts/spike_gate.gd" id="1_kye8r"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5ttkm"]
|
||||
size = Vector2(29, 4)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kye8r"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rnxg7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1536, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5ttkm"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pki7h"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lvs8d"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(64, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_40kpl"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(96, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ms1vp"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(128, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tvc1a"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(160, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vy5ys"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(192, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u2ylj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(224, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gjiar"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(256, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1dqry"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(288, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jck8c"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(320, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5xkn8"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(352, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_iv6vj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(384, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i530s"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(416, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d6ylt"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(448, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xtjjs"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(480, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ci8mo"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(512, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gmmov"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(544, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vfoxu"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(576, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ho6i7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(608, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_iubls"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(640, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m3ksf"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(672, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0822b"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(704, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_52ayd"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(736, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q0cp4"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(768, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bjex2"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(800, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sa64n"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(832, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wnpnr"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(864, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_edpr7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(896, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n1dnq"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(928, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_oeoqj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(960, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t83ji"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(992, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_x467m"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1024, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6y5l3"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1056, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dxjpb"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1088, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dnpsp"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1120, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u3fxw"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1152, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pq5cv"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1184, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_03fuj"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1216, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qtdja"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1248, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gpmon"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1280, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dt18d"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1312, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mvctv"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1344, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m214n"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1376, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r1uqq"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1408, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c1gm7"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1440, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ab08u"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1472, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r3qcl"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1504, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_osvbq"]
|
||||
atlas = ExtResource("1_5ttkm")
|
||||
region = Rect2(1536, 0, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_pki7h"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kye8r")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rnxg7")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"open",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5ttkm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pki7h")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_lvs8d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_40kpl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ms1vp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tvc1a")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vy5ys")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u2ylj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gjiar")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1dqry")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jck8c")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5xkn8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_iv6vj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_i530s")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_d6ylt")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xtjjs")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ci8mo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gmmov")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vfoxu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ho6i7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_iubls")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m3ksf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0822b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_52ayd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_q0cp4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bjex2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sa64n")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wnpnr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_edpr7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_n1dnq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_oeoqj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t83ji")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_x467m")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6y5l3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dxjpb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dnpsp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u3fxw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pq5cv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_03fuj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qtdja")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gpmon")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dt18d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mvctv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m214n")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_r1uqq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c1gm7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ab08u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_r3qcl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_osvbq")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 20.0
|
||||
}]
|
||||
|
||||
[node name="Spike Gate" type="StaticBody2D" unique_id=1020421430]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 5
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_kye8r")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=522352776]
|
||||
position = Vector2(0.5, 13)
|
||||
shape = SubResource("RectangleShape2D_5ttkm")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1790681326]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 15)
|
||||
sprite_frames = SubResource("SpriteFrames_pki7h")
|
||||
animation = &"closed"
|
||||
autoplay = "closed"
|
||||
offset = Vector2(0, -15)
|
||||
@@ -0,0 +1,11 @@
|
||||
extends Area2D
|
||||
class_name CollisionLoadingZone
|
||||
|
||||
@export var loading_zone_transporter: LoadingZoneTransporter
|
||||
|
||||
# Private Methods
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is not PlayerCharacter:
|
||||
return
|
||||
|
||||
loading_zone_transporter.Activate()
|
||||
@@ -0,0 +1 @@
|
||||
uid://ckfuj0lm6jv3i
|
||||
@@ -0,0 +1,8 @@
|
||||
extends Area2D
|
||||
class_name InteractiveLoadingZone
|
||||
|
||||
@export var loading_zone_transporter: LoadingZoneTransporter
|
||||
|
||||
# Public Methods
|
||||
func Activate() -> void:
|
||||
loading_zone_transporter.Activate()
|
||||
@@ -0,0 +1 @@
|
||||
uid://csspyy43sohfl
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Node
|
||||
class_name LoadingZoneTransporter
|
||||
|
||||
signal MapTransitionQueued(map_id: Enums.MapIds, marker_name: String)
|
||||
|
||||
@export var destination_map_id: Enums.MapIds
|
||||
@export var destination_marker_name: String
|
||||
|
||||
var _packed_scene: PackedScene
|
||||
|
||||
# Public Methods
|
||||
func Activate() -> void:
|
||||
MapTransitionQueued.emit(destination_map_id, destination_marker_name)
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
_packed_scene = MapLoader.GetMap(destination_map_id)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bvl1vdqd5cjkc
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://ca75b65eh7vv8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ckfuj0lm6jv3i" path="res://Entities/Map Objects/Loading Zone/Scripts/collision_loading_zone.gd" id="1_pb5hg"]
|
||||
|
||||
[node name="Collision Loading Zone" type="Area2D" unique_id=1043800735 groups=["Collision Loading Zone Group"]]
|
||||
collision_layer = 0
|
||||
script = ExtResource("1_pb5hg")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://cla2d3gii8qda"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://csspyy43sohfl" path="res://Entities/Map Objects/Loading Zone/Scripts/interactive_loading_zone.gd" id="1_7bdbd"]
|
||||
|
||||
[node name="Interactive Loading Zone" type="Area2D" unique_id=1427014981 groups=["Interactive Loading Zone Group"]]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_7bdbd")
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://bbules4o3xayc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvl1vdqd5cjkc" path="res://Entities/Map Objects/Loading Zone/Scripts/loading_zone_transporter.gd" id="1_p8o2m"]
|
||||
|
||||
[node name="Loading Zone Transporter" type="Node" unique_id=1690817663 groups=["Loading Zone Transporter Group"]]
|
||||
script = ExtResource("1_p8o2m")
|
||||
8
Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd
Normal file
8
Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Area2D
|
||||
|
||||
signal TargetHit
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is not CharacterBody2D:
|
||||
return
|
||||
TargetHit.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://6jls1eokv2to
|
||||
15
Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd
Normal file
15
Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Area2D
|
||||
|
||||
signal PressurePlateTripped
|
||||
|
||||
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
var activated := false
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if activated:
|
||||
return
|
||||
|
||||
activated = true
|
||||
animated_sprite_2d.play("activated")
|
||||
PressurePlateTripped.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://cxt7ht66jiac8
|
||||
13
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd
Normal file
13
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends Area2D
|
||||
class_name ShopItem
|
||||
|
||||
@export var check_location: Enums.CheckLocations
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
1
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd.uid
Normal file
1
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cggyjxrk4qqfm
|
||||
53
Entities/Map Objects/Mechanisms/arrow_target.tscn
Normal file
53
Entities/Map Objects/Mechanisms/arrow_target.tscn
Normal file
@@ -0,0 +1,53 @@
|
||||
[gd_scene format=3 uid="uid://b8m08wroe1qu2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://k2htcxstdj5v" path="res://Assets/Spritesheets/Outdoor Objects/Arrow Target-Sheet.png" id="1_b0s8y"]
|
||||
[ext_resource type="Script" uid="uid://6jls1eokv2to" path="res://Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd" id="1_uhut5"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_uhut5"]
|
||||
radius = 8.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b0s8y"]
|
||||
atlas = ExtResource("1_b0s8y")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uhut5"]
|
||||
atlas = ExtResource("1_b0s8y")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_bfwsr"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b0s8y")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"hit",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uhut5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"unhit",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="ArrowTarget" type="Area2D" unique_id=1856751990]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_uhut5")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=522196069]
|
||||
shape = SubResource("CircleShape2D_uhut5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1145493202]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 8)
|
||||
sprite_frames = SubResource("SpriteFrames_bfwsr")
|
||||
animation = &"unhit"
|
||||
autoplay = "unhit"
|
||||
offset = Vector2(0, -8)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
52
Entities/Map Objects/Mechanisms/pressure_plate.tscn
Normal file
52
Entities/Map Objects/Mechanisms/pressure_plate.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene format=3 uid="uid://b5t4h63xhuods"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cxt7ht66jiac8" path="res://Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd" id="1_po2h8"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhtolttw5h33" path="res://Assets/Spritesheets/Mechanisms/Pressure Plate.png" id="1_ulio5"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ulio5"]
|
||||
size = Vector2(12, 10)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ulio5"]
|
||||
atlas = ExtResource("1_ulio5")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_po2h8"]
|
||||
atlas = ExtResource("1_ulio5")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_50pip"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ulio5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"activated",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_po2h8")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="PressurePlate" type="Area2D" unique_id=1213720400]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 0
|
||||
script = ExtResource("1_po2h8")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=180813085]
|
||||
position = Vector2(0, -1)
|
||||
shape = SubResource("RectangleShape2D_ulio5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=3182720]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, -7)
|
||||
sprite_frames = SubResource("SpriteFrames_50pip")
|
||||
autoplay = "default"
|
||||
offset = Vector2(0, 7)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
8
Entities/Map Objects/Mechanisms/shop_item.tscn
Normal file
8
Entities/Map Objects/Mechanisms/shop_item.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://ddgeo3vwebqeg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cggyjxrk4qqfm" path="res://Entities/Map Objects/Mechanisms/Scripts/shop_item.gd" id="1_0luup"]
|
||||
|
||||
[node name="ShopItem" type="Area2D" unique_id=1768344009]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_0luup")
|
||||
78
Entities/Map Objects/Trees/Effects/Scripts/leaf_spawner.gd
Normal file
78
Entities/Map Objects/Trees/Effects/Scripts/leaf_spawner.gd
Normal file
@@ -0,0 +1,78 @@
|
||||
extends Node2D
|
||||
|
||||
@export var leaf_texture: Texture2D
|
||||
@export var spawn_markers: Node2D
|
||||
@export var destination_markers: Node2D
|
||||
|
||||
@export_range(0.0, 60.0) var minimum_schedule_gap := 20.0
|
||||
@export_range(1.0, 61.0) var maximum_schedule_gap := 60.0
|
||||
|
||||
var _spawn_markers: Array[Marker2D] = []
|
||||
var _destination_markers: Array[Marker2D] = []
|
||||
var _spawn_schedule := 0.0
|
||||
var _spawn_timer := 0.0
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
for child in spawn_markers.get_children():
|
||||
_spawn_markers.append(child)
|
||||
|
||||
for child in destination_markers.get_children():
|
||||
_destination_markers.append(child)
|
||||
|
||||
_set_random_spawn_schedule()
|
||||
|
||||
# At spawn, we might want to spawn some leaves sooner...
|
||||
_spawn_schedule -= randf_range(0.0, _spawn_schedule)
|
||||
_spawn_schedule = max(0, _spawn_schedule)
|
||||
print("%s - Leaf Spawn Schedule: %f" % [get_parent().name, _spawn_schedule])
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_spawn_timer += delta
|
||||
if _spawn_timer >= _spawn_schedule:
|
||||
_spawn_timer = 0.0
|
||||
_set_random_spawn_schedule()
|
||||
|
||||
var spawn := _get_random_spawn_point()
|
||||
var destination := _get_random_destination_point()
|
||||
|
||||
# TODO Refactor this into scene
|
||||
var sprite := Sprite2D.new()
|
||||
sprite.texture = leaf_texture
|
||||
sprite.position = spawn
|
||||
sprite.rotate(deg_to_rad(randf_range(0, 360)))
|
||||
var tween := get_tree().create_tween().tween_property(sprite, "position", destination, randf_range(2.0, 3.0))
|
||||
tween.finished.connect(
|
||||
func():
|
||||
var timer := get_tree().create_timer(randf_range(8.0, 15.0))
|
||||
timer.timeout.connect(
|
||||
func():
|
||||
if !sprite: return
|
||||
var tween2 := get_tree().create_tween().tween_property(sprite, "self_modulate:a", 0.0, randf_range(4.0, 6.0))
|
||||
tween2.finished.connect(
|
||||
func():
|
||||
if !sprite: return
|
||||
sprite.queue_free()
|
||||
)
|
||||
)
|
||||
)
|
||||
add_child(sprite)
|
||||
|
||||
|
||||
func _set_random_spawn_schedule() -> void:
|
||||
_spawn_schedule = randf_range(minimum_schedule_gap, maximum_schedule_gap)
|
||||
|
||||
|
||||
func _get_random_spawn_point() -> Vector2:
|
||||
var idx := randi_range(0, len(_spawn_markers) - 1)
|
||||
var marker := _spawn_markers[idx]
|
||||
return marker.position
|
||||
|
||||
|
||||
func _get_random_destination_point() -> Vector2:
|
||||
var idx := randi_range(0, len(_destination_markers) - 1)
|
||||
var marker := _destination_markers[idx]
|
||||
var offset := Vector2(randf_range(-5.0, 5.0), randf_range(-5.0, 5.0))
|
||||
|
||||
return marker.position + offset
|
||||
@@ -0,0 +1 @@
|
||||
uid://vmyfl4obus88
|
||||
7
Entities/Map Objects/Trees/Effects/leaf_spawner.tscn
Normal file
7
Entities/Map Objects/Trees/Effects/leaf_spawner.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://dpwm1tn0mbr3l"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vmyfl4obus88" path="res://Entities/Map Objects/Trees/Effects/Scripts/leaf_spawner.gd" id="1_l7yxv"]
|
||||
|
||||
[node name="Leaf Spawner" type="Node2D" unique_id=986945632]
|
||||
y_sort_enabled = true
|
||||
script = ExtResource("1_l7yxv")
|
||||
102
Entities/Map Objects/Trees/tree_01.tscn
Normal file
102
Entities/Map Objects/Trees/tree_01.tscn
Normal file
@@ -0,0 +1,102 @@
|
||||
[gd_scene format=3 uid="uid://cc3qat6un2323"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://xygpf7c886pj" path="res://Assets/Spritesheets/Trees/Medium_Oak_Tree.png" id="1_i2ia5"]
|
||||
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Entities/Characters/Utility/Occlusion/occlusion_culler.tscn" id="1_jbed0"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_jbed0"]
|
||||
radius = 12.0
|
||||
|
||||
[sub_resource type="Shader" id="Shader_jbed0"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform bool render_noise = false;
|
||||
uniform sampler2D noise_texture : repeat_enable; // set in inspector
|
||||
uniform float amplitude : hint_range(0.0, 0.5, 0.01) = 0.2;
|
||||
uniform float time_scale : hint_range(0.0, 5.0, 0.01) = 0.04;
|
||||
uniform float noise_scale : hint_range(0.0, 2.0, 0.0001) = 0.001;
|
||||
uniform float rotation_strength : hint_range(0.0, 5.0, 0.1) = 1;
|
||||
uniform vec2 rotation_pivot = vec2(0.5, 1);
|
||||
varying vec2 world_position;
|
||||
|
||||
void vertex(){
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
|
||||
}
|
||||
|
||||
vec2 get_sample_pos(vec2 pos, float scale, float offset) {
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
return pos;
|
||||
}
|
||||
|
||||
vec2 rotate_vec(vec2 vec, vec2 pivot, float rotation) {
|
||||
float cosa = cos(rotation);
|
||||
float sina = sin(rotation);
|
||||
vec -= pivot;
|
||||
return vec2(
|
||||
cosa * vec.x - sina * vec.y,
|
||||
cosa * vec.y + sina * vec.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// get noise from texture
|
||||
vec2 noise_sample_pos = get_sample_pos(world_position, noise_scale, TIME * time_scale);
|
||||
float noise_amount = texture(noise_texture, noise_sample_pos).r - 0.5f;
|
||||
|
||||
// get rotation position around a pivot
|
||||
float rotation = amplitude * noise_amount;
|
||||
vec2 rotated_uvs = rotate_vec(UV, rotation_pivot, rotation);
|
||||
|
||||
// blend original uvs and rotated uvs based on distance to pivot
|
||||
float dist = distance(UV, rotation_pivot) * rotation_strength;
|
||||
vec2 result_uvs = mix(UV, rotated_uvs, dist);
|
||||
|
||||
// output color
|
||||
COLOR = texture(TEXTURE, result_uvs);
|
||||
|
||||
// optional, preview noise texture for debugging
|
||||
if (render_noise) {
|
||||
vec4 noise_color = texture(noise_texture, noise_sample_pos);
|
||||
COLOR = noise_color;
|
||||
}
|
||||
}"
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_o0u4i"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b23hf"]
|
||||
shader = SubResource("Shader_jbed0")
|
||||
shader_parameter/render_noise = false
|
||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_o0u4i")
|
||||
shader_parameter/amplitude = 0.05999999865888
|
||||
shader_parameter/time_scale = 0.04
|
||||
shader_parameter/noise_scale = 0.001
|
||||
shader_parameter/rotation_strength = 1.0
|
||||
shader_parameter/rotation_pivot = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5otsd"]
|
||||
atlas = ExtResource("1_i2ia5")
|
||||
region = Rect2(32, 0, 32, 48)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0srx6"]
|
||||
size = Vector2(6, 3)
|
||||
|
||||
[node name="Tree 01" type="StaticBody2D" unique_id=2046930104]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Occlusion Culler" parent="." unique_id=1362480066 node_paths=PackedStringArray("nodes_to_occlude") instance=ExtResource("1_jbed0")]
|
||||
nodes_to_occlude = [NodePath("../Sprite2D")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culler" unique_id=731605527]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("CircleShape2D_jbed0")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_b23hf")
|
||||
position = Vector2(0, 8)
|
||||
texture = SubResource("AtlasTexture_5otsd")
|
||||
offset = Vector2(0, -8)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=870152657]
|
||||
position = Vector2(0, 6.5)
|
||||
shape = SubResource("RectangleShape2D_0srx6")
|
||||
157
Entities/Map Objects/Trees/tree_02.tscn
Normal file
157
Entities/Map Objects/Trees/tree_02.tscn
Normal file
@@ -0,0 +1,157 @@
|
||||
[gd_scene format=3 uid="uid://be6xfndyj4ckx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Entities/Characters/Utility/Occlusion/occlusion_culler.tscn" id="1_ijlg6"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6cddkuevr4hl" path="res://Assets/Spritesheets/Trees/Big_Oak_Tree-Isolated.png" id="2_mxye4"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwm1tn0mbr3l" path="res://Entities/Map Objects/Trees/Effects/leaf_spawner.tscn" id="3_n7ubj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dv2qcpyn2rk5s" path="res://Assets/Spritesheets/Trees/Oak_Leaf_Particle.png" id="4_xq3h5"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ijlg6"]
|
||||
radius = 23.021729
|
||||
|
||||
[sub_resource type="Shader" id="Shader_mxye4"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform bool render_noise = false;
|
||||
uniform sampler2D noise_texture : repeat_enable; // set in inspector
|
||||
uniform float amplitude : hint_range(0.0, 0.5, 0.01) = 0.2;
|
||||
uniform float time_scale : hint_range(0.0, 5.0, 0.01) = 0.04;
|
||||
uniform float noise_scale : hint_range(0.0, 2.0, 0.0001) = 0.001;
|
||||
uniform float rotation_strength : hint_range(0.0, 5.0, 0.1) = 1;
|
||||
uniform vec2 rotation_pivot = vec2(0.5, 1);
|
||||
varying vec2 world_position;
|
||||
|
||||
void vertex(){
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
|
||||
}
|
||||
|
||||
vec2 get_sample_pos(vec2 pos, float scale, float offset) {
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
return pos;
|
||||
}
|
||||
|
||||
vec2 rotate_vec(vec2 vec, vec2 pivot, float rotation) {
|
||||
float cosa = cos(rotation);
|
||||
float sina = sin(rotation);
|
||||
vec -= pivot;
|
||||
return vec2(
|
||||
cosa * vec.x - sina * vec.y,
|
||||
cosa * vec.y + sina * vec.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// get noise from texture
|
||||
vec2 noise_sample_pos = get_sample_pos(world_position, noise_scale, TIME * time_scale);
|
||||
float noise_amount = texture(noise_texture, noise_sample_pos).r - 0.5f;
|
||||
|
||||
// get rotation position around a pivot
|
||||
float rotation = amplitude * noise_amount;
|
||||
vec2 rotated_uvs = rotate_vec(UV, rotation_pivot, rotation);
|
||||
|
||||
// blend original uvs and rotated uvs based on distance to pivot
|
||||
float dist = distance(UV, rotation_pivot) * rotation_strength;
|
||||
vec2 result_uvs = mix(UV, rotated_uvs, dist);
|
||||
|
||||
// output color
|
||||
COLOR = texture(TEXTURE, result_uvs);
|
||||
|
||||
// optional, preview noise texture for debugging
|
||||
if (render_noise) {
|
||||
vec4 noise_color = texture(noise_texture, noise_sample_pos);
|
||||
COLOR = noise_color;
|
||||
}
|
||||
}"
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_pv2vp"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ocj51"]
|
||||
shader = SubResource("Shader_mxye4")
|
||||
shader_parameter/render_noise = false
|
||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_pv2vp")
|
||||
shader_parameter/amplitude = 0.1999999955296
|
||||
shader_parameter/time_scale = 0.04
|
||||
shader_parameter/noise_scale = 0.001
|
||||
shader_parameter/rotation_strength = 1.0
|
||||
shader_parameter/rotation_pivot = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0srx6"]
|
||||
size = Vector2(16, 10)
|
||||
|
||||
[node name="Tree 02" type="StaticBody2D" unique_id=2046930104]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Occlusion Culler" parent="." unique_id=1362480066 node_paths=PackedStringArray("nodes_to_occlude") instance=ExtResource("1_ijlg6")]
|
||||
nodes_to_occlude = [NodePath("../Sprite2D")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culler" unique_id=1085880925]
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("CircleShape2D_ijlg6")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_ocj51")
|
||||
position = Vector2(0, 24)
|
||||
texture = ExtResource("2_mxye4")
|
||||
offset = Vector2(0, -24)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=870152657]
|
||||
position = Vector2(0, 19)
|
||||
shape = SubResource("RectangleShape2D_0srx6")
|
||||
|
||||
[node name="Leaf Spawner" parent="." unique_id=986945632 node_paths=PackedStringArray("spawn_markers", "destination_markers") instance=ExtResource("3_n7ubj")]
|
||||
leaf_texture = ExtResource("4_xq3h5")
|
||||
spawn_markers = NodePath("Spawn Markers")
|
||||
destination_markers = NodePath("Destination Markers")
|
||||
|
||||
[node name="Spawn Markers" type="Node2D" parent="Leaf Spawner" unique_id=718423149]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=110047229]
|
||||
position = Vector2(-10, -19)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1030089042]
|
||||
position = Vector2(-15, -2)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1530367987]
|
||||
position = Vector2(9, 4)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=2042975279]
|
||||
position = Vector2(15, -10)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=712311756]
|
||||
position = Vector2(8, -24)
|
||||
|
||||
[node name="Destination Markers" type="Node2D" parent="Leaf Spawner" unique_id=1860944141]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=608985314]
|
||||
position = Vector2(-23, 14)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=860056803]
|
||||
position = Vector2(-27, 25)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=457722512]
|
||||
position = Vector2(-15, 21)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1184860371]
|
||||
position = Vector2(-5, 30)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=181196191]
|
||||
position = Vector2(6, 26)
|
||||
|
||||
[node name="Marker2D6" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1185929582]
|
||||
position = Vector2(18, 34)
|
||||
|
||||
[node name="Marker2D7" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=180258159]
|
||||
position = Vector2(25, 18)
|
||||
|
||||
[node name="Marker2D8" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1566992504]
|
||||
position = Vector2(14, 20)
|
||||
|
||||
[node name="Marker2D9" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1862213394]
|
||||
position = Vector2(16, 11)
|
||||
|
||||
[node name="Marker2D10" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=489682641]
|
||||
position = Vector2(30, 8)
|
||||
|
||||
[node name="Marker2D11" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=495586307]
|
||||
position = Vector2(-34, 12)
|
||||
207
Entities/Map Objects/Trees/tree_03.tscn
Normal file
207
Entities/Map Objects/Trees/tree_03.tscn
Normal file
@@ -0,0 +1,207 @@
|
||||
[gd_scene format=3 uid="uid://bcx1d8kvp7o0h"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bhdecga15imvk" path="res://Assets/Spritesheets/Trees/Big_Spruce_tree.png" id="1_xun88"]
|
||||
[ext_resource type="PackedScene" uid="uid://d24gcv3umq60k" path="res://Entities/Characters/Utility/Occlusion/occlusion_culler.tscn" id="2_45i4c"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwm1tn0mbr3l" path="res://Entities/Map Objects/Trees/Effects/leaf_spawner.tscn" id="3_nua4y"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckvfo6bl606hp" path="res://Assets/Spritesheets/Trees/Spruce_Needle_Particle.png" id="4_34ibr"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_13veg"]
|
||||
radius = 15.033297
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_34ibr"]
|
||||
radius = 8.0
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_bbkr4"]
|
||||
radius = 3.0
|
||||
|
||||
[sub_resource type="Shader" id="Shader_34ibr"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform bool render_noise = false;
|
||||
uniform sampler2D noise_texture : repeat_enable; // set in inspector
|
||||
uniform float amplitude : hint_range(0.0, 0.5, 0.01) = 0.2;
|
||||
uniform float time_scale : hint_range(0.0, 5.0, 0.01) = 0.04;
|
||||
uniform float noise_scale : hint_range(0.0, 2.0, 0.0001) = 0.001;
|
||||
uniform float rotation_strength : hint_range(0.0, 5.0, 0.1) = 1;
|
||||
uniform vec2 rotation_pivot = vec2(0.5, 1);
|
||||
varying vec2 world_position;
|
||||
|
||||
void vertex(){
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
|
||||
}
|
||||
|
||||
vec2 get_sample_pos(vec2 pos, float scale, float offset) {
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
return pos;
|
||||
}
|
||||
|
||||
vec2 rotate_vec(vec2 vec, vec2 pivot, float rotation) {
|
||||
float cosa = cos(rotation);
|
||||
float sina = sin(rotation);
|
||||
vec -= pivot;
|
||||
return vec2(
|
||||
cosa * vec.x - sina * vec.y,
|
||||
cosa * vec.y + sina * vec.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// get noise from texture
|
||||
vec2 noise_sample_pos = get_sample_pos(world_position, noise_scale, TIME * time_scale);
|
||||
float noise_amount = texture(noise_texture, noise_sample_pos).r - 0.5f;
|
||||
|
||||
// get rotation position around a pivot
|
||||
float rotation = amplitude * noise_amount;
|
||||
vec2 rotated_uvs = rotate_vec(UV, rotation_pivot, rotation);
|
||||
|
||||
// blend original uvs and rotated uvs based on distance to pivot
|
||||
float dist = distance(UV, rotation_pivot) * rotation_strength;
|
||||
vec2 result_uvs = mix(UV, rotated_uvs, dist);
|
||||
|
||||
// output color
|
||||
COLOR = texture(TEXTURE, result_uvs);
|
||||
|
||||
// optional, preview noise texture for debugging
|
||||
if (render_noise) {
|
||||
vec4 noise_color = texture(noise_texture, noise_sample_pos);
|
||||
COLOR = noise_color;
|
||||
}
|
||||
}"
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bbkr4"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b4y2c"]
|
||||
shader = SubResource("Shader_34ibr")
|
||||
shader_parameter/render_noise = false
|
||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_bbkr4")
|
||||
shader_parameter/amplitude = 0.03999999910592
|
||||
shader_parameter/time_scale = 0.04
|
||||
shader_parameter/noise_scale = 0.001
|
||||
shader_parameter/rotation_strength = 1.0
|
||||
shader_parameter/rotation_pivot = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5otsd"]
|
||||
atlas = ExtResource("1_xun88")
|
||||
region = Rect2(64, 0, 64, 80)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0srx6"]
|
||||
size = Vector2(16, 10)
|
||||
|
||||
[node name="Tree 03" type="StaticBody2D" unique_id=2046930104]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Occlusion Culler" parent="." unique_id=1362480066 node_paths=PackedStringArray("nodes_to_occlude") instance=ExtResource("2_45i4c")]
|
||||
nodes_to_occlude = [NodePath("../Sprite2D")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culler" unique_id=585236031]
|
||||
shape = SubResource("CircleShape2D_13veg")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Occlusion Culler" unique_id=1731688944]
|
||||
position = Vector2(0, -18)
|
||||
shape = SubResource("CircleShape2D_34ibr")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Occlusion Culler" unique_id=424659978]
|
||||
position = Vector2(0, -32)
|
||||
shape = SubResource("CircleShape2D_bbkr4")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1420512565]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_b4y2c")
|
||||
position = Vector2(0, 24)
|
||||
texture = SubResource("AtlasTexture_5otsd")
|
||||
offset = Vector2(0, -24)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=870152657]
|
||||
position = Vector2(0, 19)
|
||||
shape = SubResource("RectangleShape2D_0srx6")
|
||||
|
||||
[node name="Leaf Spawner" parent="." unique_id=986945632 node_paths=PackedStringArray("spawn_markers", "destination_markers") instance=ExtResource("3_nua4y")]
|
||||
leaf_texture = ExtResource("4_34ibr")
|
||||
spawn_markers = NodePath("Spawn Markers")
|
||||
destination_markers = NodePath("Destination Markers")
|
||||
|
||||
[node name="Spawn Markers" type="Node2D" parent="Leaf Spawner" unique_id=992261793]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1312492144]
|
||||
position = Vector2(-14, 5)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1942462835]
|
||||
position = Vector2(-11, -4)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=810574820]
|
||||
position = Vector2(-7, -15)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=291879085]
|
||||
position = Vector2(-3, -29)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1559139972]
|
||||
position = Vector2(4, -30)
|
||||
|
||||
[node name="Marker2D6" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=842452431]
|
||||
position = Vector2(7, -22)
|
||||
|
||||
[node name="Marker2D7" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=947896890]
|
||||
position = Vector2(10, -12)
|
||||
|
||||
[node name="Marker2D8" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1254697051]
|
||||
position = Vector2(11, 1)
|
||||
|
||||
[node name="Marker2D9" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=598463156]
|
||||
position = Vector2(13, 12)
|
||||
|
||||
[node name="Marker2D10" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=1632041472]
|
||||
position = Vector2(7, 14)
|
||||
|
||||
[node name="Marker2D11" type="Marker2D" parent="Leaf Spawner/Spawn Markers" unique_id=705248658]
|
||||
position = Vector2(-7, 14)
|
||||
|
||||
[node name="Destination Markers" type="Node2D" parent="Leaf Spawner" unique_id=1084196582]
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1434626655]
|
||||
position = Vector2(-17, 19)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1985496050]
|
||||
position = Vector2(-32, 27)
|
||||
|
||||
[node name="Marker2D3" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=612599198]
|
||||
position = Vector2(-30, 15)
|
||||
|
||||
[node name="Marker2D4" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1750692117]
|
||||
position = Vector2(-19, 33)
|
||||
|
||||
[node name="Marker2D5" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1637274691]
|
||||
position = Vector2(-7, 38)
|
||||
|
||||
[node name="Marker2D6" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=270534968]
|
||||
position = Vector2(-1, 30)
|
||||
|
||||
[node name="Marker2D7" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1580580484]
|
||||
position = Vector2(-8, 27)
|
||||
|
||||
[node name="Marker2D8" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1666879158]
|
||||
position = Vector2(14, 38)
|
||||
|
||||
[node name="Marker2D9" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=33388155]
|
||||
position = Vector2(12, 30)
|
||||
|
||||
[node name="Marker2D10" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1245617655]
|
||||
position = Vector2(24, 25)
|
||||
|
||||
[node name="Marker2D11" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=709006321]
|
||||
position = Vector2(19, 20)
|
||||
|
||||
[node name="Marker2D12" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=602455411]
|
||||
position = Vector2(28, 14)
|
||||
|
||||
[node name="Marker2D13" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=264453249]
|
||||
position = Vector2(35, 28)
|
||||
|
||||
[node name="Marker2D14" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=2036567999]
|
||||
position = Vector2(28, 36)
|
||||
|
||||
[node name="Marker2D15" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1663646612]
|
||||
position = Vector2(-26, 34)
|
||||
|
||||
[node name="Marker2D16" type="Marker2D" parent="Leaf Spawner/Destination Markers" unique_id=1858656621]
|
||||
position = Vector2(-26, 34)
|
||||
17
Entities/Weapons/Projectiles/Scripts/base_projectile.gd
Normal file
17
Entities/Weapons/Projectiles/Scripts/base_projectile.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends CharacterBody2D
|
||||
class_name BaseProjectile
|
||||
|
||||
@export var direction: Vector2
|
||||
@export var speed := 100
|
||||
|
||||
# Public Methods
|
||||
func SetProjectileStartAndDirection(start_position: Vector2, projectile_direction: Vector2) -> void:
|
||||
position = start_position
|
||||
direction = projectile_direction
|
||||
rotation = projectile_direction.angle()
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _physics_process(delta: float) -> void:
|
||||
velocity = direction * speed * delta
|
||||
move_and_slide()
|
||||
@@ -0,0 +1 @@
|
||||
uid://8q26ldhfyijx
|
||||
29
Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd
Normal file
29
Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends BaseProjectile
|
||||
class_name WoodenArrow
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||
|
||||
var _despawn_queued := false
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
speed = 8000
|
||||
|
||||
|
||||
func _on_collision_detector_area_entered(_area: Area2D) -> void:
|
||||
queue_despawn()
|
||||
|
||||
|
||||
func _on_collision_detector_body_entered(body: Node2D) -> void:
|
||||
if body == self: return
|
||||
queue_despawn()
|
||||
|
||||
|
||||
func queue_despawn() -> void:
|
||||
if _despawn_queued: return
|
||||
_despawn_queued = true
|
||||
|
||||
animation_player.play("shaking")
|
||||
await animation_player.animation_finished
|
||||
|
||||
queue_free()
|
||||
1
Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd.uid
Normal file
1
Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://j5yj4piyfql1
|
||||
8
Entities/Weapons/Projectiles/base_projectile.tscn
Normal file
8
Entities/Weapons/Projectiles/base_projectile.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://bc8u3wlyag7c4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://8q26ldhfyijx" path="res://Entities/Weapons/Projectiles/Scripts/base_projectile.gd" id="1_0qxu7"]
|
||||
|
||||
[node name="BaseProjectile" type="CharacterBody2D" unique_id=647680377]
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_0qxu7")
|
||||
103
Entities/Weapons/Projectiles/wooden_arrow.tscn
Normal file
103
Entities/Weapons/Projectiles/wooden_arrow.tscn
Normal file
@@ -0,0 +1,103 @@
|
||||
[gd_scene format=3 uid="uid://b2wq5m01b68rx"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://hop1gedjh8s4" path="res://Assets/Spritesheets/Player/icons_full_32.png" id="1_0h1c2"]
|
||||
[ext_resource type="Script" uid="uid://j5yj4piyfql1" path="res://Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd" id="1_44gti"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0h1c2"]
|
||||
size = Vector2(10, 2)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_44gti"]
|
||||
size = Vector2(11, 2)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_44gti"]
|
||||
atlas = ExtResource("1_0h1c2")
|
||||
region = Rect2(320, 1056, 32, 32)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_44gti"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.7853982]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_321dg"]
|
||||
resource_name = "shaking"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [0.7853982, 1.1344640137963142, 0.7853982, 0.4363323129985824, 0.7853982]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, -1.705), Vector2(0, 0), Vector2(0, 1.73), Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_m21sp"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_44gti"),
|
||||
&"shaking": SubResource("Animation_321dg")
|
||||
}
|
||||
|
||||
[node name="Wooden Arrow" type="CharacterBody2D" unique_id=609733948]
|
||||
z_index = 1
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_44gti")
|
||||
metadata/_custom_type_script = "uid://8q26ldhfyijx"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1657279556]
|
||||
shape = SubResource("RectangleShape2D_0h1c2")
|
||||
|
||||
[node name="Collision Detector" type="Area2D" parent="." unique_id=367998143]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Collision Detector" unique_id=740276065]
|
||||
position = Vector2(0.5, 0)
|
||||
shape = SubResource("RectangleShape2D_44gti")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=442865143]
|
||||
rotation = 0.7853982
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = SubResource("AtlasTexture_44gti")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1874694929]
|
||||
libraries/ = SubResource("AnimationLibrary_m21sp")
|
||||
|
||||
[connection signal="area_entered" from="Collision Detector" to="." method="_on_collision_detector_area_entered"]
|
||||
[connection signal="body_entered" from="Collision Detector" to="." method="_on_collision_detector_body_entered"]
|
||||
Reference in New Issue
Block a user