forked from team-sg/hero-mark-2
sped up name entry, added delete, and max char limit
This commit is contained in:
parent
62e6e23d94
commit
098ab161de
17 changed files with 134 additions and 25 deletions
|
@ -12,3 +12,4 @@ func _process(delta):
|
|||
func _gui_input(event):
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
get_parent().set_kill_mode(!get_parent().kill_mode)
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
|
|
|
@ -13,3 +13,4 @@ func _process(delta):
|
|||
func _gui_input(event):
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
SceneManager.current_scene = next_scene.instance()
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
|
|
|
@ -76,11 +76,17 @@ func _difficulty_selected() -> void:
|
|||
Fade.fade_in(0.4)
|
||||
|
||||
func _on_letter_chosen(letter: String) -> void:
|
||||
file.name += letter
|
||||
if file.name.length() < 8:
|
||||
file.name += letter
|
||||
chosen_name.text = file.name
|
||||
if file.name.length() > 0:
|
||||
$"%ExitDoor".frame = 1
|
||||
|
||||
func _on_backspace():
|
||||
# file.name.erase(file.name.length() - 1,1)
|
||||
file.name = file.name.left(file.name.length() - 1)
|
||||
chosen_name.text = file.name
|
||||
print(file.name.length())
|
||||
|
||||
func _on_Exit_area_entered(area: Area2D) -> void:
|
||||
if file.name.length() > 0:
|
||||
|
|
|
@ -75,6 +75,9 @@ unique_name_in_owner = true
|
|||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="DifficultySelect"]
|
||||
material = ExtResource( 8 )
|
||||
|
@ -258,6 +261,8 @@ tile_data = PoolIntArray( -1, 0, 1, -65536, 0, 196610, -65535, 0, 196610, -65534
|
|||
[node name="Player" parent="NameEntry" instance=ExtResource( 10 )]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2( 16, 160 )
|
||||
walk_speed = 100.0
|
||||
climb_speed = 78.0
|
||||
|
||||
[node name="Ladders" type="TileMap" parent="NameEntry"]
|
||||
tile_set = ExtResource( 12 )
|
||||
|
@ -298,76 +303,80 @@ glyph = 6
|
|||
position = Vector2( 200, 128 )
|
||||
glyph = 7
|
||||
|
||||
[node name="LetterBlock27" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 224, 128 )
|
||||
glyph = 36
|
||||
|
||||
[node name="LetterBlock9" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 32, 72 )
|
||||
position = Vector2( 40, 72 )
|
||||
glyph = 8
|
||||
|
||||
[node name="LetterBlock10" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 56, 72 )
|
||||
position = Vector2( 64, 72 )
|
||||
glyph = 9
|
||||
|
||||
[node name="LetterBlock11" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 80, 72 )
|
||||
position = Vector2( 88, 72 )
|
||||
glyph = 10
|
||||
|
||||
[node name="LetterBlock12" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 104, 72 )
|
||||
position = Vector2( 112, 72 )
|
||||
glyph = 11
|
||||
|
||||
[node name="LetterBlock13" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 128, 72 )
|
||||
position = Vector2( 136, 72 )
|
||||
glyph = 12
|
||||
|
||||
[node name="LetterBlock14" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 152, 72 )
|
||||
position = Vector2( 160, 72 )
|
||||
glyph = 13
|
||||
|
||||
[node name="LetterBlock15" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 176, 72 )
|
||||
position = Vector2( 184, 72 )
|
||||
glyph = 14
|
||||
|
||||
[node name="LetterBlock16" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 200, 72 )
|
||||
position = Vector2( 208, 72 )
|
||||
glyph = 15
|
||||
|
||||
[node name="LetterBlock17" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 224, 72 )
|
||||
position = Vector2( 232, 72 )
|
||||
glyph = 16
|
||||
|
||||
[node name="LetterBlock18" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 32, 16 )
|
||||
position = Vector2( 40, 16 )
|
||||
glyph = 17
|
||||
|
||||
[node name="LetterBlock19" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 56, 16 )
|
||||
position = Vector2( 64, 16 )
|
||||
glyph = 18
|
||||
|
||||
[node name="LetterBlock20" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 80, 16 )
|
||||
position = Vector2( 88, 16 )
|
||||
glyph = 19
|
||||
|
||||
[node name="LetterBlock21" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 104, 16 )
|
||||
position = Vector2( 112, 16 )
|
||||
glyph = 20
|
||||
|
||||
[node name="LetterBlock22" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 128, 16 )
|
||||
position = Vector2( 136, 16 )
|
||||
glyph = 21
|
||||
|
||||
[node name="LetterBlock23" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 152, 16 )
|
||||
position = Vector2( 160, 16 )
|
||||
glyph = 22
|
||||
|
||||
[node name="LetterBlock24" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 176, 16 )
|
||||
position = Vector2( 184, 16 )
|
||||
glyph = 23
|
||||
|
||||
[node name="LetterBlock25" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 200, 16 )
|
||||
position = Vector2( 208, 16 )
|
||||
glyph = 24
|
||||
|
||||
[node name="LetterBlock26" parent="NameEntry/Letters" instance=ExtResource( 11 )]
|
||||
position = Vector2( 224, 16 )
|
||||
position = Vector2( 232, 16 )
|
||||
glyph = 25
|
||||
|
||||
[node name="Exit" type="Area2D" parent="NameEntry"]
|
||||
|
@ -376,12 +385,13 @@ position = Vector2( 229, 148 )
|
|||
[node name="ExitDoor" type="Sprite" parent="NameEntry/Exit"]
|
||||
unique_name_in_owner = true
|
||||
material = SubResource( 5 )
|
||||
position = Vector2( 19, 0 )
|
||||
texture = ExtResource( 14 )
|
||||
hframes = 2
|
||||
region_rect = Rect2( 0, 0, 16, 24 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="NameEntry/Exit"]
|
||||
position = Vector2( 0, 4 )
|
||||
position = Vector2( 19, 4 )
|
||||
shape = SubResource( 6 )
|
||||
|
||||
[node name="Ladder" parent="NameEntry" instance=ExtResource( 15 )]
|
||||
|
|
|
@ -26,3 +26,9 @@ func set_kill_mode(value):
|
|||
else:
|
||||
description.text = "Select your destiny"
|
||||
flavor_text.text = "Adventure awaits"
|
||||
|
||||
#func play_select_sound():
|
||||
# Audio.play_sound(Audio.a_select,Audio.ac_collectible)
|
||||
|
||||
#func play_confirm_sound():
|
||||
# Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
|
|
|
@ -17,6 +17,7 @@ func _ready():
|
|||
|
||||
|
||||
func select() -> void:
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
if get_parent().kill_mode == false:
|
||||
# if a file exists, load and play it!
|
||||
if file:
|
||||
|
|
|
@ -16,26 +16,32 @@ func _ready():
|
|||
|
||||
Vector2( 0.83205, 0.5547 )
|
||||
|
||||
func play_select_sound():
|
||||
Audio.play_sound(Audio.a_select,Audio.ac_collectible)
|
||||
|
||||
func _on_Continue_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance()
|
||||
|
||||
|
||||
func _on_FileSelect_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/file_select.tscn").instance()
|
||||
|
||||
|
||||
func _on_Exit_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_SoundTest_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/sound_test.tscn").instance()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue