Added LD55_1.mp3 (Gander's theme).

Added spritesheet for Gander Schwartz (the main character).

More dialoge for introduction.
This commit is contained in:
Stephen Seo 2024-04-13 15:35:28 +09:00
parent 935263cc59
commit 5366561c58
8 changed files with 314 additions and 13 deletions

View file

@ -8,16 +8,33 @@ extends Node2D
@onready var wind_diamond = $WindDiamond @onready var wind_diamond = $WindDiamond
@onready var earth_diamond = $EarthDiamond @onready var earth_diamond = $EarthDiamond
@onready var audio_stream_player = $AudioStreamPlayer @onready var music_player = $MusicPlayer
const text_speed = 0.08
const start_text = "You seek the elementals?\nProve your worth!\nShow the elements your mastery over summoning, and they are yours!" const start_text = "You seek the elementals?\nProve your worth!\nShow the elements your mastery over summoning, and they are yours!"
const intro_text_00 = "The name's Gander Schwartz.\nBut my friends call me the \"Wandering Gander\"."
const intro_text_01 = "I'm what most would call a \"third-rate summoner\",\nbut there's a reason for that.\nI summon \"items\", not \"beasts\"."
const intro_text_02 = "Most summoners summon beasts to fight for them.\nI summon items to fight with, or even tools to solve puzzles in dungeons."
const diamond_angle_rate = 1.2 const diamond_angle_rate = 1.2
const diamond_dist_rate = 50.0 const diamond_dist_rate = 50.0
const diamond_start_dist = 800.0 const diamond_start_dist = 800.0
const diamond_min_dist = 150.0 const diamond_min_dist = 150.0
enum StateT {Start, Start_TextRendered, Start_Stopping, MainMenu} enum StateT {
Start,
Start_TextRendered,
Start_Stopping,
MainMenu,
Introduction_00,
Introduction_00_post,
Introduction_01,
Introduction_01_post,
Introduction_02,
Introduction_02_post
}
static var state_dict = {} static var state_dict = {}
@ -25,6 +42,8 @@ var tween_volume
var diamonds_gone = false var diamonds_gone = false
var music_file
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
if not state_dict.has("state"): if not state_dict.has("state"):
@ -35,21 +54,25 @@ func _ready():
"dist": diamond_start_dist, "dist": diamond_start_dist,
"angle" : 0.0 "angle" : 0.0
} }
audio_stream_player.play() music_player.play()
func update_text(text, next_state):
if state_dict["timer"] > text_speed:
main_label.text += text[state_dict["text_idx"]]
state_dict["text_idx"] += 1
state_dict["timer"] = 0.0
if state_dict["text_idx"] >= text.length():
state_dict["state"] = next_state
state_dict["text_idx"] = 0
state_dict["timer"] = 0.0
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
state_dict["timer"] += delta state_dict["timer"] += delta
match state_dict["state"]: match state_dict["state"]:
StateT.Start: StateT.Start:
if state_dict["timer"] > 0.15: update_text(start_text, StateT.Start_TextRendered)
main_label.text += start_text[state_dict["text_idx"]]
state_dict["text_idx"] += 1
state_dict["timer"] = 0.0
if state_dict["text_idx"] >= start_text.length():
state_dict["state"] = StateT.Start_TextRendered
state_dict["text_idx"] = 0
update_start_diamonds(delta) update_start_diamonds(delta)
StateT.Start_TextRendered: StateT.Start_TextRendered:
update_start_diamonds(delta) update_start_diamonds(delta)
@ -58,6 +81,35 @@ func _process(delta):
update_stop_diamonds(delta) update_stop_diamonds(delta)
StateT.MainMenu: StateT.MainMenu:
update_stop_diamonds(delta) update_stop_diamonds(delta)
state_dict["state"] = StateT.Introduction_00
state_dict["timer"] = 0.0
state_dict["text_idx"] = 0
main_label.text = ""
lower_label.text = ""
music_player.volume_db = 0.0
music_player.stream = AudioStreamMP3.new()
music_file = FileAccess.open("res://audio/LD55_1.mp3", FileAccess.READ)
music_player.stream.data = music_file.get_buffer(music_file.get_length())
music_player.play()
StateT.Introduction_00:
update_stop_diamonds(delta)
update_text(intro_text_00, StateT.Introduction_00_post)
StateT.Introduction_00_post:
if not diamonds_gone:
state_dict["start_diamonds"]["dist"] = diamond_start_dist
diamonds_gone = true
fire_diamond.get_parent().remove_child(fire_diamond)
water_diamond.get_parent().remove_child(water_diamond)
wind_diamond.get_parent().remove_child(wind_diamond)
earth_diamond.get_parent().remove_child(earth_diamond)
StateT.Introduction_01:
update_text(intro_text_01, StateT.Introduction_01_post)
StateT.Introduction_01_post:
pass
StateT.Introduction_02:
update_text(intro_text_02, StateT.Introduction_02_post)
StateT.Introduction_02_post:
pass
_: _:
pass pass
@ -72,15 +124,40 @@ func _unhandled_input(event):
StateT.Start_TextRendered: StateT.Start_TextRendered:
state_dict["state"] = StateT.Start_Stopping state_dict["state"] = StateT.Start_Stopping
tween_volume = get_tree().create_tween() tween_volume = get_tree().create_tween()
tween_volume.tween_property(audio_stream_player, "volume_db", -80.0, 4.0) tween_volume.tween_property(music_player, "volume_db", -80.0, 4.0)
tween_volume.tween_callback(start_volume_tween_callback) tween_volume.tween_callback(start_volume_tween_callback)
main_label.text = "" main_label.text = ""
lower_label.text = "" lower_label.text = ""
StateT.Introduction_00:
main_label.text = intro_text_00
state_dict["text_idx"] = 0
state_dict["timer"] = 0.0
state_dict["state"] = StateT.Introduction_00_post
StateT.Introduction_00_post:
state_dict["state"] = StateT.Introduction_01
state_dict["timer"] = 0.0
state_dict["text_idx"] = 0
main_label.text = ""
StateT.Introduction_01:
state_dict["state"] = StateT.Introduction_01_post
state_dict["timer"] = 0.0
state_dict["text_idx"] = 0
main_label.text = intro_text_01
StateT.Introduction_01_post:
state_dict["state"] = StateT.Introduction_02
state_dict["timer"] = 0.0
state_dict["text_idx"] = 0
main_label.text = ""
StateT.Introduction_02:
state_dict["state"] = StateT.Introduction_02_post
state_dict["timer"] = 0.0
state_dict["text_idx"] = 0
main_label.text = intro_text_02
_: _:
pass pass
func start_volume_tween_callback(): func start_volume_tween_callback():
audio_stream_player.stop() music_player.stop()
state_dict["state"] = StateT.MainMenu state_dict["state"] = StateT.MainMenu
func diamond_position_update(): func diamond_position_update():

BIN
audio/LD55_1.mp3 Normal file

Binary file not shown.

19
audio/LD55_1.mp3.import Normal file
View file

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://bvwdr73umr2qr"
path="res://.godot/imported/LD55_1.mp3-4700eba67d0f245e9181c0848472465f.mp3str"
[deps]
source_file="res://audio/LD55_1.mp3"
dest_files=["res://.godot/imported/LD55_1.mp3-4700eba67d0f245e9181c0848472465f.mp3str"]
[params]
loop=true
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

170
gander_schwartz.tscn Normal file
View file

@ -0,0 +1,170 @@
[gd_scene load_steps=19 format=3 uid="uid://ktxqc7xtqkex"]
[ext_resource type="Texture2D" uid="uid://cv0qw4j1q78r8" path="res://gimp/GanderSchwartz_spritesheet.png" id="1_n7bds"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mj0lb"]
atlas = ExtResource("1_n7bds")
region = Rect2(16, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_nj8be"]
atlas = ExtResource("1_n7bds")
region = Rect2(0, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_fv2wk"]
atlas = ExtResource("1_n7bds")
region = Rect2(48, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_0fiw5"]
atlas = ExtResource("1_n7bds")
region = Rect2(32, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ymdq1"]
atlas = ExtResource("1_n7bds")
region = Rect2(16, 48, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_a7slw"]
atlas = ExtResource("1_n7bds")
region = Rect2(16, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_7fcfo"]
atlas = ExtResource("1_n7bds")
region = Rect2(16, 96, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_uehe8"]
atlas = ExtResource("1_n7bds")
region = Rect2(16, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_h0ch1"]
atlas = ExtResource("1_n7bds")
region = Rect2(0, 48, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_cklih"]
atlas = ExtResource("1_n7bds")
region = Rect2(0, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_emnkr"]
atlas = ExtResource("1_n7bds")
region = Rect2(0, 96, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ba8ji"]
atlas = ExtResource("1_n7bds")
region = Rect2(0, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ewgtu"]
atlas = ExtResource("1_n7bds")
region = Rect2(48, 48, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_btquh"]
atlas = ExtResource("1_n7bds")
region = Rect2(48, 0, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_d26uv"]
atlas = ExtResource("1_n7bds")
region = Rect2(32, 48, 16, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_tbyxn"]
atlas = ExtResource("1_n7bds")
region = Rect2(32, 0, 16, 48)
[sub_resource type="SpriteFrames" id="SpriteFrames_i348s"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mj0lb")
}],
"loop": true,
"name": &"facing_back",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nj8be")
}],
"loop": true,
"name": &"facing_front",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_fv2wk")
}],
"loop": true,
"name": &"facing_left",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_0fiw5")
}],
"loop": true,
"name": &"facing_right",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ymdq1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a7slw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7fcfo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_uehe8")
}],
"loop": true,
"name": &"walking_back",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_h0ch1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_cklih")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_emnkr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ba8ji")
}],
"loop": true,
"name": &"walking_front",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ewgtu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_btquh")
}],
"loop": true,
"name": &"walking_left",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_d26uv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tbyxn")
}],
"loop": true,
"name": &"walking_right",
"speed": 5.0
}]
[node name="GanderSchwartz" type="CharacterBody2D"]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
position = Vector2(0, -24)
sprite_frames = SubResource("SpriteFrames_i348s")
animation = &"walking_front"
frame = 3
frame_progress = 0.126405
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cv0qw4j1q78r8"
path="res://.godot/imported/GanderSchwartz_spritesheet.png-940de9fac32557b89f0dd061f56cadd5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gimp/GanderSchwartz_spritesheet.png"
dest_files=["res://.godot/imported/GanderSchwartz_spritesheet.png-940de9fac32557b89f0dd061f56cadd5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -42,5 +42,5 @@ texture = ExtResource("4_u6w6s")
position = Vector2(-980, 90) position = Vector2(-980, 90)
texture = ExtResource("5_3irym") texture = ExtResource("5_3irym")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] [node name="MusicPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("6_3kpot") stream = ExtResource("6_3kpot")

View file

@ -29,6 +29,7 @@ Cancel={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":0,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"echo":false,"script":null)
] ]
} }
Left={ Left={