diff --git a/autoloads/level_data.tscn b/autoloads/level_data.tscn index e2a8193..fe92a6f 100644 --- a/autoloads/level_data.tscn +++ b/autoloads/level_data.tscn @@ -29,8 +29,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "" boss = false -scores_id = 13253 -times_id = 13255 +has_scoreboard = true scene = ExtResource( 2 ) [sub_resource type="Resource" id=2] @@ -45,8 +44,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "" boss = false -scores_id = 13254 -times_id = 13257 +has_scoreboard = true scene = ExtResource( 3 ) [sub_resource type="Resource" id=4] @@ -61,8 +59,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "" boss = false -scores_id = 13263 -times_id = 13270 +has_scoreboard = true scene = ExtResource( 6 ) [sub_resource type="Resource" id=6] @@ -77,8 +74,7 @@ shards_required_spicy = 16 shards_required_pungent = 24 boss_required = "" boss = true -scores_id = -1 -times_id = -1 +has_scoreboard = false scene = ExtResource( 8 ) [sub_resource type="Resource" id=3] @@ -93,8 +89,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "boss1" boss = false -scores_id = 13264 -times_id = 13271 +has_scoreboard = true scene = ExtResource( 14 ) [sub_resource type="Resource" id=10] @@ -109,8 +104,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "boss1" boss = false -scores_id = 13265 -times_id = 13272 +has_scoreboard = true scene = ExtResource( 7 ) [sub_resource type="Resource" id=9] @@ -125,8 +119,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "boss1" boss = false -scores_id = 13266 -times_id = 13273 +has_scoreboard = true scene = ExtResource( 11 ) [sub_resource type="Resource" id=12] @@ -141,8 +134,7 @@ shards_required_spicy = 32 shards_required_pungent = 40 boss_required = "" boss = true -scores_id = -1 -times_id = -1 +has_scoreboard = false scene = ExtResource( 13 ) [sub_resource type="Resource" id=8] @@ -157,8 +149,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "boss2" boss = false -scores_id = 13267 -times_id = 13274 +has_scoreboard = true scene = ExtResource( 10 ) [sub_resource type="Resource" id=7] @@ -173,8 +164,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "boss2" boss = false -scores_id = 13268 -times_id = 13275 +has_scoreboard = true scene = ExtResource( 9 ) [sub_resource type="Resource" id=11] @@ -189,8 +179,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "boss2" boss = false -scores_id = 13269 -times_id = 13276 +has_scoreboard = true scene = ExtResource( 12 ) [sub_resource type="Resource" id=15] @@ -205,8 +194,7 @@ shards_required_spicy = 50 shards_required_pungent = 60 boss_required = "" boss = true -scores_id = -1 -times_id = -1 +has_scoreboard = false scene = ExtResource( 16 ) [sub_resource type="Resource" id=14] @@ -221,8 +209,7 @@ shards_required_spicy = 72 shards_required_pungent = 72 boss_required = "boss3" boss = false -scores_id = -1 -times_id = -1 +has_scoreboard = false scene = ExtResource( 4 ) [sub_resource type="Resource" id=13] @@ -237,8 +224,7 @@ shards_required_spicy = 0 shards_required_pungent = 0 boss_required = "" boss = false -scores_id = -1 -times_id = -1 +has_scoreboard = false scene = ExtResource( 15 ) [node name="LevelData" type="Node"] diff --git a/export_presets.cfg b/export_presets.cfg index 7a3e24a..75f22d9 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -5,7 +5,7 @@ platform="Windows Desktop" runnable=true custom_features="" export_filter="all_resources" -include_filter="ngio.ini" +include_filter="scoreboard_host.txt" exclude_filter="" export_path="build/Revolution 2083.exe" script_export_mode=1 @@ -33,6 +33,7 @@ codesign/description="" codesign/custom_options=PoolStringArray( ) application/modify_resources=true application/icon="res://icon.ico" +application/icon_interpolation=4 application/file_version="" application/product_version="" application/company_name="Team SG" @@ -48,7 +49,7 @@ platform="Linux/X11" runnable=true custom_features="" export_filter="all_resources" -include_filter="ngio.ini" +include_filter="scoreboard_host.txt" exclude_filter="" export_path="build/linux/Revolution 2083.x86_64" script_export_mode=1 @@ -58,7 +59,7 @@ script_encryption_key="" custom_template/debug="" custom_template/release="" -binary_format/64_bits=true +binary_format/architecture="x86_64" binary_format/embed_pck=true texture_format/bptc=false texture_format/s3tc=true @@ -73,7 +74,7 @@ platform="HTML5" runnable=true custom_features="" export_filter="all_resources" -include_filter="ngio.ini" +include_filter="scoreboard_host.txt" exclude_filter="" export_path="build/html5/index.html" script_export_mode=1 @@ -108,7 +109,7 @@ platform="Android" runnable=true custom_features="" export_filter="all_resources" -include_filter="" +include_filter="scoreboard_host.txt" exclude_filter="" export_path="build/android/hero-mark-2.apk" script_export_mode=1 @@ -241,6 +242,7 @@ permissions/mount_format_filesystems=false permissions/mount_unmount_filesystems=false permissions/nfc=false permissions/persistent_activity=false +permissions/post_notifications=false permissions/process_outgoing_calls=false permissions/read_calendar=false permissions/read_call_log=false diff --git a/graphics/hud/arrow_down.png b/graphics/hud/arrow_down.png new file mode 100644 index 0000000..b077880 Binary files /dev/null and b/graphics/hud/arrow_down.png differ diff --git a/graphics/hud/arrow_down.png.import b/graphics/hud/arrow_down.png.import new file mode 100644 index 0000000..147e2b1 --- /dev/null +++ b/graphics/hud/arrow_down.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow_down.png-476089e36c213673a0f11adb99cc0724.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/hud/arrow_down.png" +dest_files=[ "res://.import/arrow_down.png-476089e36c213673a0f11adb99cc0724.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/graphics/hud/arrow_up.png b/graphics/hud/arrow_up.png new file mode 100644 index 0000000..795cca0 Binary files /dev/null and b/graphics/hud/arrow_up.png differ diff --git a/graphics/hud/arrow_up.png.import b/graphics/hud/arrow_up.png.import new file mode 100644 index 0000000..b303c7a --- /dev/null +++ b/graphics/hud/arrow_up.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow_up.png-afb605e867089f8aedd83a8cc3ba6369.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/hud/arrow_up.png" +dest_files=[ "res://.import/arrow_up.png-afb605e867089f8aedd83a8cc3ba6369.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/graphics/hud/scores/pungent.png b/graphics/hud/scores/pungent.png new file mode 100644 index 0000000..7754646 Binary files /dev/null and b/graphics/hud/scores/pungent.png differ diff --git a/graphics/hud/scores/pungent.png.import b/graphics/hud/scores/pungent.png.import new file mode 100644 index 0000000..1265a85 --- /dev/null +++ b/graphics/hud/scores/pungent.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/pungent.png-e07e66e400d4d252772a81c6867bb967.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/hud/scores/pungent.png" +dest_files=[ "res://.import/pungent.png-e07e66e400d4d252772a81c6867bb967.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/graphics/hud/scores/salty.png b/graphics/hud/scores/salty.png new file mode 100644 index 0000000..af22ef1 Binary files /dev/null and b/graphics/hud/scores/salty.png differ diff --git a/graphics/hud/scores/salty.png.import b/graphics/hud/scores/salty.png.import new file mode 100644 index 0000000..06ae307 --- /dev/null +++ b/graphics/hud/scores/salty.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/salty.png-44a2905ee6e3795b4fc59059696696a8.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/hud/scores/salty.png" +dest_files=[ "res://.import/salty.png-44a2905ee6e3795b4fc59059696696a8.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/graphics/hud/scores/spicy.png b/graphics/hud/scores/spicy.png new file mode 100644 index 0000000..ddace82 Binary files /dev/null and b/graphics/hud/scores/spicy.png differ diff --git a/graphics/hud/scores/spicy.png.import b/graphics/hud/scores/spicy.png.import new file mode 100644 index 0000000..2e03a1a --- /dev/null +++ b/graphics/hud/scores/spicy.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/spicy.png-a2205eedcb443d8faf52477db79df90f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/hud/scores/spicy.png" +dest_files=[ "res://.import/spicy.png-a2205eedcb443d8faf52477db79df90f.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/graphics/hud/scores/sweet.png b/graphics/hud/scores/sweet.png new file mode 100644 index 0000000..7dc896c Binary files /dev/null and b/graphics/hud/scores/sweet.png differ diff --git a/graphics/hud/scores/sweet.png.import b/graphics/hud/scores/sweet.png.import new file mode 100644 index 0000000..8ed72ac --- /dev/null +++ b/graphics/hud/scores/sweet.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/sweet.png-9fd594d4011ef7c51cf9c89d5c0132b0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/hud/scores/sweet.png" +dest_files=[ "res://.import/sweet.png-9fd594d4011ef7c51cf9c89d5c0132b0.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/menus/main_menu.gd b/menus/main_menu.gd index 3856a39..f91fb60 100644 --- a/menus/main_menu.gd +++ b/menus/main_menu.gd @@ -52,7 +52,7 @@ func _on_HighScores_button_down() -> void: Game.last_mm_button = @"Panel/HighScores" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") - SceneManager.current_scene = load("res://menus/scoreboards.tscn").instance() + SceneManager.current_scene = load("res://menus/scoreboards_scholar.tscn").instance() func _on_Options_button_down() -> void: diff --git a/menus/results.gd b/menus/results.gd index 641b3eb..7c320e6 100644 --- a/menus/results.gd +++ b/menus/results.gd @@ -1,7 +1,6 @@ extends Node const Text3D = preload("res://objects/hud/3d_text.tscn") -const SubmitScore = preload("res://menus/submit_score.tscn") const LevelSelect := preload("res://menus/level_select_scholar.tscn") onready var shards: Node2D = $ShardsAndBonuses/Shards diff --git a/menus/score_entry.gd b/menus/score_entry.gd index d59a2ce..89927e3 100644 --- a/menus/score_entry.gd +++ b/menus/score_entry.gd @@ -1,26 +1,47 @@ tool extends HBoxContainer +const DIFFICULTY_ICONS = [ + preload("res://graphics/hud/scores/sweet.png"), + preload("res://graphics/hud/scores/salty.png"), + preload("res://graphics/hud/scores/spicy.png"), + preload("res://graphics/hud/scores/pungent.png"), +] + export var place: int = 0 setget _set_place -export var user: String = "Username" setget _set_user -export var score: String = "00000" setget _set_score +export var player: String = "Username" setget _set_player +export var score: int = 0 setget _set_score +export var time: float = 0.0 setget _set_time +export(int, "Sweet", "Salty", "Spicy", "Pungent") var difficulty: int = 0 setget _set_difficulty func _ready() -> void: - $Place.text = " %01d " % place - $User.text = user - $Score.text = score + _set_place(place) + _set_player(player) + _set_score(score) + _set_time(time) + _set_difficulty(difficulty) func _set_place(value: int) -> void: place = value if is_inside_tree(): - $Place.text = " %01d " % place + $Place.text = "%d" % place -func _set_user(value: String) -> void: - user = value +func _set_player(value: String) -> void: + player = value.substr(0, 10) if is_inside_tree(): - $User.text = user + $Player.text = player -func _set_score(value: String) -> void: +func _set_score(value: int) -> void: score = value if is_inside_tree(): - $Score.text = score + $Score.text = "%05d" % score + +func _set_time(value: float) -> void: + time = value + if is_inside_tree(): + $Time.text = Game.format_time(time) + +func _set_difficulty(value: int) -> void: + difficulty = value + if is_inside_tree(): + $Difficulty.texture = DIFFICULTY_ICONS[difficulty] diff --git a/menus/score_entry.tscn b/menus/score_entry.tscn index 2eaac8c..26aaa66 100644 --- a/menus/score_entry.tscn +++ b/menus/score_entry.tscn @@ -1,32 +1,60 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://ui/theme.tres" type="Theme" id=1] [ext_resource path="res://menus/score_entry.gd" type="Script" id=2] +[ext_resource path="res://graphics/hud/scores/sweet.png" type="Texture" id=3] +[ext_resource path="res://ui/2ndpuberty_scholar_outline.fnt" type="BitmapFont" id=4] [node name="ScoreEntry" type="HBoxContainer"] -margin_right = 210.0 -margin_bottom = 10.0 +margin_right = 228.0 +margin_bottom = 12.0 +rect_min_size = Vector2( 0, 12 ) theme = ExtResource( 1 ) custom_constants/separation = 8 script = ExtResource( 2 ) -user = "--------" -score = "-----" +player = "coolplayer" [node name="Place" type="Label" parent="."] -margin_right = 21.0 -margin_bottom = 10.0 -text = " 0 " +margin_top = 1.0 +margin_right = 16.0 +margin_bottom = 11.0 +rect_min_size = Vector2( 16, 0 ) +custom_fonts/font = ExtResource( 4 ) +text = "0" +align = 1 -[node name="User" type="Label" parent="."] -margin_left = 29.0 -margin_right = 167.0 -margin_bottom = 10.0 -size_flags_horizontal = 3 -text = "--------" +[node name="Player" type="Label" parent="."] +margin_left = 24.0 +margin_top = 1.0 +margin_right = 94.0 +margin_bottom = 11.0 +rect_min_size = Vector2( 70, 0 ) +custom_fonts/font = ExtResource( 4 ) +text = "coolplayer" +align = 1 [node name="Score" type="Label" parent="."] -margin_left = 175.0 -margin_right = 210.0 -margin_bottom = 10.0 -text = "-----" +margin_left = 102.0 +margin_top = 1.0 +margin_right = 137.0 +margin_bottom = 11.0 +rect_min_size = Vector2( 35, 0 ) +custom_fonts/font = ExtResource( 4 ) +text = "00000" align = 2 + +[node name="Time" type="Label" parent="."] +margin_left = 145.0 +margin_top = 1.0 +margin_right = 201.0 +margin_bottom = 11.0 +rect_min_size = Vector2( 56, 0 ) +custom_fonts/font = ExtResource( 4 ) +text = "--:--.--" +align = 2 + +[node name="Difficulty" type="TextureRect" parent="."] +margin_left = 209.0 +margin_right = 221.0 +margin_bottom = 12.0 +texture = ExtResource( 3 ) diff --git a/menus/scoreboards_scholar.gd b/menus/scoreboards_scholar.gd new file mode 100644 index 0000000..10b3f05 --- /dev/null +++ b/menus/scoreboards_scholar.gd @@ -0,0 +1,108 @@ +extends Node + + +const PAGE_SIZE: int = 8 + + +var loaded_scores: Dictionary = {} +var selected_level: int = 0 +var _page: int = 0 + + +onready var scores: VBoxContainer = $"%Scores" +onready var level_title: Button = $"%LevelTitle" + + +func _ready() -> void: + yield(_refresh_scores(), "completed") + Fade.fade_in(Options.transition_speed_secs) + + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("ui_right"): + selected_level = posmod(selected_level + 1, LevelData.levels.size()) + while not LevelData.levels[selected_level].has_scoreboard: + selected_level = posmod(selected_level + 1, LevelData.levels.size()) + _refresh_scores() + elif event.is_action_pressed("ui_left"): + selected_level = posmod(selected_level - 1, LevelData.levels.size()) + while not LevelData.levels[selected_level].has_scoreboard: + selected_level = posmod(selected_level - 1, LevelData.levels.size()) + _refresh_scores() + elif event.is_action_pressed("ui_down"): + _page += 1 + _refresh_scores() + elif event.is_action_pressed("ui_up"): + _page = int(max(_page - 1, 0)) + _refresh_scores() + elif event.is_action_pressed("ui_cancel"): + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.current_scene = preload("res://menus/main_menu.tscn").instance() + + +func _refresh_scores() -> void: + level_title.text = LevelData.levels[selected_level].title + + var level = LevelData.levels[selected_level].save_id + if not level in loaded_scores: + yield(_load_scores(level), "completed") + + if ScoreBoard.errored: + push_error("Scoreboard could not be loaded.") + + var entries = loaded_scores.get(level, {}) + + while _page * PAGE_SIZE > entries.size(): + _page -= 1 + + var offset = _page * PAGE_SIZE + + $"%PrevScores".visible = _page > 0 + $"%NextScores".visible = entries.size() - offset > PAGE_SIZE + + for i in 8: + var entry_node = scores.get_node("ScoreEntry%d" % i) + if i >= entries.size() - offset: + entry_node.visible = false + else: + var player = entries.keys()[offset + i] + var entry = entries[player] + entry_node.visible = true + entry_node.place = offset + i + 1 + entry_node.player = player + entry_node.score = entry.score + entry_node.time = float(entry.time) * 0.001 # convert from ms + entry_node.difficulty = entry.difficulty + + +func _load_scores(level: String) -> void: + var result: Dictionary = yield(ScoreBoard.get_scores(level), "completed") + if ScoreBoard.errored: + #TODO: failure indication + return + + var players = result.keys().duplicate() + _sorting_dict = result + players.sort_custom(self, "_sort_scores") + + loaded_scores[level] = {} + for p in players: + loaded_scores[level][p] = result[p] + + +var _sorting_dict: Dictionary = {} +func _sort_scores(a, b) -> bool: + var score_a = _sorting_dict[a] + var score_b = _sorting_dict[b] + + if score_b.score < score_a.score: + return true + elif score_b.score == score_a.score: + if score_b.difficulty < score_a.difficulty: + return true + elif score_b.difficulty == score_a.difficulty: + if score_b.time > score_a.time: + return true + + return false diff --git a/menus/scoreboards_scholar.tscn b/menus/scoreboards_scholar.tscn new file mode 100644 index 0000000..bd9af0f --- /dev/null +++ b/menus/scoreboards_scholar.tscn @@ -0,0 +1,320 @@ +[gd_scene load_steps=16 format=2] + +[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1] +[ext_resource path="res://menus/scoreboards_scholar.gd" type="Script" id=2] +[ext_resource path="res://graphics/hud/arrow_down.png" type="Texture" id=3] +[ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=4] +[ext_resource path="res://ui/theme.tres" type="Theme" id=5] +[ext_resource path="res://graphics/hud/pause_arrow.png" type="Texture" id=6] +[ext_resource path="res://menus/score_entry.tscn" type="PackedScene" id=7] +[ext_resource path="res://ui/2ndpuberty_scholar_outline.fnt" type="BitmapFont" id=8] +[ext_resource path="res://graphics/hud/arrow_up.png" type="Texture" id=9] + +[sub_resource type="ShaderMaterial" id=1] +shader = ExtResource( 1 ) +shader_param/color_1 = Color( 0.615686, 0.670588, 0.984314, 1 ) +shader_param/color_2 = Color( 1, 0.709804, 0.984314, 1 ) +shader_param/checker_size = Vector2( 24, 12 ) +shader_param/pan_speed = Vector2( 0, 0 ) +shader_param/cycle_speed = Vector2( 8, -8 ) +shader_param/cycle_alternation = Vector2( 0, 1 ) +shader_param/uv_transform = Transform2D( 1, 0, 1, 1, 0, 0 ) + +[sub_resource type="ShaderMaterial" id=2] +shader = ExtResource( 4 ) +shader_param/speed = Vector2( 4, 0 ) +shader_param/ammount = Vector2( 2, 0 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 0, 0 ) + +[sub_resource type="ShaderMaterial" id=3] +shader = ExtResource( 4 ) +shader_param/speed = Vector2( 4, 0 ) +shader_param/ammount = Vector2( 2, 0 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 4, 0 ) + +[sub_resource type="ShaderMaterial" id=5] +shader = ExtResource( 4 ) +shader_param/speed = Vector2( 0, 4 ) +shader_param/ammount = Vector2( 0, 2 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 0, 0 ) + +[sub_resource type="ShaderMaterial" id=6] +shader = ExtResource( 4 ) +shader_param/speed = Vector2( 0, 4 ) +shader_param/ammount = Vector2( 0, 2 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 0, 4 ) + +[sub_resource type="ShaderMaterial" id=4] +shader = ExtResource( 4 ) +shader_param/speed = Vector2( 8, 4 ) +shader_param/ammount = Vector2( 12, 24 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 0, 0 ) + +[node name="Scoreboards" type="Node"] +script = ExtResource( 2 ) + +[node name="Background" type="ColorRect" parent="."] +material = SubResource( 1 ) +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="BoardsScreen" type="VBoxContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 5 ) +custom_constants/separation = 0 + +[node name="SelectLevel" type="HBoxContainer" parent="BoardsScreen"] +margin_right = 256.0 +margin_bottom = 16.0 +rect_min_size = Vector2( 0, 16 ) +alignment = 1 + +[node name="BackArrow" type="TextureRect" parent="BoardsScreen/SelectLevel"] +unique_name_in_owner = true +material = SubResource( 2 ) +margin_left = 72.0 +margin_top = 4.0 +margin_right = 78.0 +margin_bottom = 12.0 +size_flags_vertical = 4 +texture = ExtResource( 6 ) +flip_h = true + +[node name="LevelTitle" type="Button" parent="BoardsScreen/SelectLevel"] +unique_name_in_owner = true +margin_left = 82.0 +margin_top = 3.0 +margin_right = 173.0 +margin_bottom = 13.0 +size_flags_vertical = 4 +theme = ExtResource( 5 ) +custom_colors/font_color_focus = Color( 1, 0.968627, 0.709804, 1 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_fonts/font = ExtResource( 8 ) +text = "Verdant Hills" + +[node name="NextArrow" type="TextureRect" parent="BoardsScreen/SelectLevel"] +unique_name_in_owner = true +material = SubResource( 3 ) +margin_left = 177.0 +margin_top = 4.0 +margin_right = 183.0 +margin_bottom = 12.0 +size_flags_vertical = 4 +texture = ExtResource( 6 ) + +[node name="Scoreboard" type="HBoxContainer" parent="BoardsScreen"] +margin_top = 16.0 +margin_right = 256.0 +margin_bottom = 192.0 +focus_mode = 2 +size_flags_vertical = 3 +alignment = 1 + +[node name="PrevBoard" type="TextureRect" parent="BoardsScreen/Scoreboard"] +unique_name_in_owner = true +visible = false +material = SubResource( 2 ) +margin_top = 84.0 +margin_right = 6.0 +margin_bottom = 92.0 +size_flags_vertical = 4 +texture = ExtResource( 6 ) +flip_h = true + +[node name="MarginContainer" type="MarginContainer" parent="BoardsScreen/Scoreboard"] +margin_left = 10.0 +margin_right = 246.0 +margin_bottom = 176.0 +custom_constants/margin_right = 4 +custom_constants/margin_top = 4 +custom_constants/margin_left = 4 +custom_constants/margin_bottom = 4 + +[node name="VBoxContainer" type="VBoxContainer" parent="BoardsScreen/Scoreboard/MarginContainer"] +margin_left = 4.0 +margin_top = 4.0 +margin_right = 232.0 +margin_bottom = 172.0 + +[node name="Header" type="HBoxContainer" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer"] +margin_right = 228.0 +margin_bottom = 10.0 +rect_min_size = Vector2( 228, 10 ) +custom_constants/separation = 8 + +[node name="Place" type="Label" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/Header"] +margin_right = 16.0 +margin_bottom = 10.0 +rect_min_size = Vector2( 16, 0 ) +custom_fonts/font = ExtResource( 8 ) +text = "#" +align = 1 + +[node name="Player" type="Label" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/Header"] +margin_left = 24.0 +margin_right = 94.0 +margin_bottom = 10.0 +rect_min_size = Vector2( 70, 0 ) +custom_fonts/font = ExtResource( 8 ) +text = "Player" +align = 1 +clip_text = true + +[node name="Score" type="Label" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/Header"] +margin_left = 102.0 +margin_right = 137.0 +margin_bottom = 10.0 +rect_min_size = Vector2( 35, 0 ) +custom_fonts/font = ExtResource( 8 ) +text = "score" +align = 2 + +[node name="Time" type="Label" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/Header"] +margin_left = 145.0 +margin_right = 201.0 +margin_bottom = 10.0 +rect_min_size = Vector2( 56, 0 ) +custom_fonts/font = ExtResource( 8 ) +text = "score" +align = 1 + +[node name="Control" type="Control" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/Header"] +margin_left = 209.0 +margin_right = 221.0 +margin_bottom = 10.0 +rect_min_size = Vector2( 12, 0 ) + +[node name="HSeparator" type="HSeparator" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer"] +margin_top = 14.0 +margin_right = 228.0 +margin_bottom = 15.0 +custom_constants/separation = 1 + +[node name="ScoreboardTabs" type="Control" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +margin_top = 19.0 +margin_right = 228.0 +margin_bottom = 168.0 +size_flags_vertical = 3 + +[node name="Scores" type="VBoxContainer" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs"] +unique_name_in_owner = true +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="PrevScores" type="TextureRect" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores"] +unique_name_in_owner = true +visible = false +material = SubResource( 5 ) +margin_left = 110.0 +margin_right = 118.0 +margin_bottom = 8.0 +rect_pivot_offset = Vector2( 3, 4 ) +size_flags_horizontal = 4 +size_flags_vertical = 4 +texture = ExtResource( 9 ) + +[node name="ScoreEntry0" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +place = 1 + +[node name="ScoreEntry1" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 16.0 +margin_bottom = 28.0 +place = 2 + +[node name="ScoreEntry2" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 32.0 +margin_bottom = 44.0 +place = 3 + +[node name="ScoreEntry3" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 48.0 +margin_bottom = 60.0 +place = 4 + +[node name="ScoreEntry4" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 64.0 +margin_bottom = 76.0 +place = 5 + +[node name="ScoreEntry5" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 80.0 +margin_bottom = 92.0 +place = 6 + +[node name="ScoreEntry6" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 96.0 +margin_bottom = 108.0 +place = 7 + +[node name="ScoreEntry7" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores" instance=ExtResource( 7 )] +margin_top = 112.0 +margin_bottom = 124.0 +place = 8 + +[node name="NextScores" type="TextureRect" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/Scores"] +unique_name_in_owner = true +visible = false +material = SubResource( 6 ) +margin_left = 110.0 +margin_top = 128.0 +margin_right = 118.0 +margin_bottom = 136.0 +rect_pivot_offset = Vector2( 3, 4 ) +size_flags_horizontal = 4 +size_flags_vertical = 4 +texture = ExtResource( 3 ) + +[node name="LoadingIndicator" type="CenterContainer" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/LoadingIndicator"] +material = SubResource( 4 ) +margin_left = 110.0 +margin_top = 69.0 +margin_right = 117.0 +margin_bottom = 79.0 +text = "ยง" + +[node name="FailedIndicator" type="CenterContainer" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="Label" type="Label" parent="BoardsScreen/Scoreboard/MarginContainer/VBoxContainer/ScoreboardTabs/FailedIndicator"] +margin_left = 65.0 +margin_top = 69.0 +margin_right = 163.0 +margin_bottom = 79.0 +text = "Failed to load" + +[node name="PanelContainer" type="PanelContainer" parent="BoardsScreen/Scoreboard"] +visible = false +margin_left = 250.0 +margin_right = 474.0 +margin_bottom = 144.0 +rect_min_size = Vector2( 224, 144 ) +size_flags_horizontal = 4 +size_flags_vertical = 0 + +[node name="NextBoard" type="TextureRect" parent="BoardsScreen/Scoreboard"] +unique_name_in_owner = true +visible = false +material = SubResource( 3 ) +margin_left = 250.0 +margin_top = 84.0 +margin_right = 256.0 +margin_bottom = 92.0 +size_flags_horizontal = 0 +size_flags_vertical = 4 +texture = ExtResource( 6 ) diff --git a/project.godot b/project.godot index 4b61178..d94c3f8 100644 --- a/project.godot +++ b/project.godot @@ -109,7 +109,6 @@ SceneManager="*res://autoloads/scene_manager.tscn" Console="*res://autoloads/console.tscn" Fade="*res://autoloads/fade.tscn" StainLayer="*res://autoloads/stain_layer.tscn" -Ngio="*res://autoloads/ngio.gd" ScoreBoard="*res://autoloads/scoreboard.gd" [debug] diff --git a/scripts/level_entry.gd b/scripts/level_entry.gd index 55024db..db1b37c 100644 --- a/scripts/level_entry.gd +++ b/scripts/level_entry.gd @@ -16,8 +16,7 @@ export var shards_required_spicy: int = 0 export var shards_required_pungent: int = 0 export var boss_required: String = "" export var boss: bool = false -export var scores_id: int = -1 -export var times_id: int = -1 +export var has_scoreboard: bool = false export var scene: PackedScene var shards_required: int = 0 setget , _get_shards_required