Added Level resource type & catalog

This commit is contained in:
Rob Kelly 2024-12-17 11:12:56 -07:00
parent f7acce772f
commit 47383f60b6
9 changed files with 89 additions and 1 deletions

View File

@ -3,9 +3,11 @@ UI_UNSET,unset
UI_LISTEN,listening...
UI_CANCEL,Cancel
UI_ACCEPT,Accept
UI_START,Start!
UI_ON,On
UI_OFF,Off
UI_BACK,"⏎ Back"
UI_LOCKED,Locked
UI_GOAL,Goal!
,
TITLE_START,"- Press Start -"
@ -23,6 +25,11 @@ TITLE_NETWORK_MULTI,"Online Multiplayer"
TITLE_PROFILE,Profile
TITLE_CREDITS,Credits
,
DM_HEADING,"Real GFOLF - Local Setup"
DM_MAP,"Select a Map"
DM_PLAYERS,Gfolfers
DM_ADD_PLAYER,"Add a Gfolfer"
DM_NAME_PLACEHOLDER,"Enter a name"
,
PAUSE_HEADING,Paused
PAUSE_RESUME,Resume
@ -124,3 +131,5 @@ BALL_PLASMA,Plasma
BALL_BRICK,Brick
BALL_BEACH,"Beach Ball"
BALL_POWER,Powerball
,
MAP_DEBUG,"Debug Island"

1 keys en
3 UI_LISTEN listening...
4 UI_CANCEL Cancel
5 UI_ACCEPT Accept
6 UI_START Start!
7 UI_ON On
8 UI_OFF Off
9 UI_BACK ⏎ Back
10 UI_LOCKED Locked
11 UI_GOAL Goal!
12
13 TITLE_START - Press Start -
25 TITLE_PROFILE Profile
26 TITLE_CREDITS Credits
27
28 DM_HEADING Real GFOLF - Local Setup
29 DM_MAP Select a Map
30 DM_PLAYERS Gfolfers
31 DM_ADD_PLAYER Add a Gfolfer
32 DM_NAME_PLACEHOLDER Enter a name
33
34 PAUSE_HEADING Paused
35 PAUSE_RESUME Resume
131 BALL_BRICK Brick
132 BALL_BEACH Beach Ball
133 BALL_POWER Powerball
134
135 MAP_DEBUG Debug Island

View File

@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Level" load_steps=4 format=3 uid="uid://chewry1b1a28j"]
[ext_resource type="Texture2D" uid="uid://dlqet1c5a7j7k" path="res://levels/debug_level/preview.jpg" id="1_1ewcj"]
[ext_resource type="PackedScene" uid="uid://bm2o3mex10v11" path="res://levels/debug_level/debug_level.tscn" id="2_eu01o"]
[ext_resource type="Script" path="res://src/world/level_catalog/level.gd" id="3_83327"]
[resource]
script = ExtResource("3_83327")
scene = ExtResource("2_eu01o")
level_name = "MAP_DEBUG"
preview = ExtResource("1_1ewcj")

View File

@ -365,7 +365,7 @@ shape = SubResource("BoxShape3D_x3wvm")
transform = Transform3D(-0.74629, 0, -0.665621, 0, 1, 0, 0.665621, 0, -0.74629, 381.024, -0.5, 224.968)
[node name="ItemSpawner" type="Marker3D" parent="Course/WaterTable/Sailboat"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.73528, 0.292423, 0.248718)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 5)
script = ExtResource("8_5kaye")
item = ExtResource("8_3jmdx")
amount = -1
@ -374,6 +374,7 @@ spawn_turns = 1
[node name="Flag" parent="Course" instance=ExtResource("13_6jtao")]
transform = Transform3D(-0.777146, 0, -0.629321, 0, 1, 0, 0.629321, 0, -0.777146, 540, 4, 452)
visible = false
[node name="TestSpawners" type="Node3D" parent="Course"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 228.164, 4, 274.211)

BIN
levels/debug_level/preview.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dlqet1c5a7j7k"
path="res://.godot/imported/preview.jpg-00ef6b4680c54da42f46dbea949541d6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://levels/debug_level/preview.jpg"
dest_files=["res://.godot/imported/preview.jpg-00ef6b4680c54da42f46dbea949541d6.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=true
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

@ -21,6 +21,7 @@ run/max_fps=60
GameRuntime="*res://src/game/game_runtime.gd"
ClubCatalog="*res://src/equipment/clubs/club_catalog.tscn"
LevelCatalog="*res://src/world/level/level_catalog.gd"
GameSettings="*res://src/game/game_settings.gd"
[debug]

16
src/world/level/level.gd Normal file
View File

@ -0,0 +1,16 @@
class_name Level extends Resource
## Container for a level scene & associated data.
## Scene file of this level.
@export var scene: PackedScene
## Name of the level (or corresponding i18n key)
@export var level_name: String
## Preview image for the level. Will be used for thumbnails.
@export var preview: Texture2D
## Global typesafe accessor for level catalog
static var catalog: LevelCatalogType:
get:
return LevelCatalog

View File

@ -0,0 +1,4 @@
class_name LevelCatalogType extends Node
## Provides access to levels.
@export var levels: Array[Level] = []

View File

@ -0,0 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://cdtdvka0bssgy"]
[ext_resource type="Script" path="res://src/world/level/level_catalog.gd" id="1_wjjeu"]
[ext_resource type="Resource" uid="uid://chewry1b1a28j" path="res://levels/debug_level/debug_island.tres" id="3_3eqbc"]
[ext_resource type="Script" path="res://src/world/level/level.gd" id="3_8lfqu"]
[node name="LevelCatalog" type="Node"]
script = ExtResource("1_wjjeu")
levels = Array[ExtResource("3_8lfqu")]([ExtResource("3_3eqbc")])