diff --git a/assets/icons/court.svg b/assets/icons/court.svg new file mode 100644 index 0000000..2687184 --- /dev/null +++ b/assets/icons/court.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + diff --git a/assets/icons/court.svg.import b/assets/icons/court.svg.import new file mode 100644 index 0000000..3b6d2e2 --- /dev/null +++ b/assets/icons/court.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8vse4cqbr55f" +path="res://.godot/imported/court.svg-870294249b3b9207b540813d3efa57aa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/court.svg" +dest_files=["res://.godot/imported/court.svg-870294249b3b9207b540813d3efa57aa.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/icons/player.svg b/assets/icons/player.svg index 5457cb8..d3c641c 100644 --- a/assets/icons/player.svg +++ b/assets/icons/player.svg @@ -1,29 +1,83 @@ + + + + + + - - - + + + + + + + + diff --git a/assets/icons/player.svg.import b/assets/icons/player.svg.import index e64ed17..12c3a9b 100644 --- a/assets/icons/player.svg.import +++ b/assets/icons/player.svg.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dmjg5fnkoonco" +uid="uid://dgph2rb7qswca" path="res://.godot/imported/player.svg-a2bcd8e0436a01647bdc15db60a237aa.ctex" metadata={ "vram_texture": false diff --git a/assets/players/red_big.png b/assets/players/red_big.png new file mode 100644 index 0000000..a5d0f66 Binary files /dev/null and b/assets/players/red_big.png differ diff --git a/assets/players/red_big.png.import b/assets/players/red_big.png.import new file mode 100644 index 0000000..b8118c2 --- /dev/null +++ b/assets/players/red_big.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://w10nqq5ng8n5" +path="res://.godot/imported/red_big.png-14b67fd2781cab4f920bbaff9afeafde.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/players/red_big.png" +dest_files=["res://.godot/imported/red_big.png-14b67fd2781cab4f920bbaff9afeafde.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/players/red_guard.png b/assets/players/red_guard.png new file mode 100644 index 0000000..166fb9b Binary files /dev/null and b/assets/players/red_guard.png differ diff --git a/assets/players/red_guard.png.import b/assets/players/red_guard.png.import new file mode 100644 index 0000000..415f141 --- /dev/null +++ b/assets/players/red_guard.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cn2xfwvejclvo" +path="res://.godot/imported/red_guard.png-7c53a2c883f8413f0110cd68e3b728ba.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/players/red_guard.png" +dest_files=["res://.godot/imported/red_guard.png-7c53a2c883f8413f0110cd68e3b728ba.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/game.tscn b/game.tscn index 75b11e0..ac2348d 100644 --- a/game.tscn +++ b/game.tscn @@ -4,22 +4,101 @@ [ext_resource type="PackedScene" uid="uid://cxbu51aedxg3c" path="res://court.tscn" id="1_e2o6t"] [ext_resource type="PackedScene" uid="uid://boqs7k6ia532h" path="res://player.tscn" id="2_feb5d"] [ext_resource type="Texture2D" uid="uid://cdisx65vqrn21" path="res://assets/players/red_wing.png" id="3_fc0e3"] -[ext_resource type="Script" uid="uid://bbey5ttwv5utd" path="res://scripts/player_attributes.gd" id="4_7jktm"] +[ext_resource type="Script" uid="uid://vb7lr6djyhnv" path="res://scripts/team.gd" id="3_hve3p"] +[ext_resource type="Script" uid="uid://bbey5ttwv5utd" path="res://scripts/custom resources/player_attributes.gd" id="4_7jktm"] +[ext_resource type="Texture2D" uid="uid://46vgqxp2imyw" path="res://assets/players/blue_guard.png" id="4_j5wjh"] +[ext_resource type="Script" uid="uid://c7dxj0ifl687s" path="res://scripts/custom resources/team_attributes.gd" id="4_mfdv2"] [ext_resource type="PackedScene" uid="uid://cbqaj6trvqat0" path="res://ball.tscn" id="6_ryrav"] +[ext_resource type="Texture2D" uid="uid://df7cknvvngtij" path="res://assets/players/blue_big.png" id="6_vef74"] +[ext_resource type="Texture2D" uid="uid://dl54l4wvub6ro" path="res://assets/players/blue_wing.png" id="7_hve3p"] +[ext_resource type="PackedScene" uid="uid://cfq463kejcp2m" path="res://team.tscn" id="11_mfdv2"] +[ext_resource type="Texture2D" uid="uid://cn2xfwvejclvo" path="res://assets/players/red_guard.png" id="12_iotsf"] +[ext_resource type="Texture2D" uid="uid://w10nqq5ng8n5" path="res://assets/players/red_big.png" id="14_215e1"] + +[sub_resource type="Resource" id="Resource_lc2xo"] +script = ExtResource("4_mfdv2") +team_name = "Blue Devils" +team_color = Color(0, 0, 1, 1) +metadata/_custom_type_script = "uid://c7dxj0ifl687s" [sub_resource type="Resource" id="Resource_ryrav"] script = ExtResource("4_7jktm") +player_name = "Kirt" +player_texture = ExtResource("4_j5wjh") +metadata/_custom_type_script = "uid://bbey5ttwv5utd" + +[sub_resource type="Resource" id="Resource_mfdv2"] +script = ExtResource("4_7jktm") +player_name = "Greg" +player_position = 1 +player_texture = ExtResource("7_hve3p") +metadata/_custom_type_script = "uid://bbey5ttwv5utd" + +[sub_resource type="Resource" id="Resource_iotsf"] +script = ExtResource("4_7jktm") +player_name = "Cheryl" +player_position = 2 +player_texture = ExtResource("6_vef74") +metadata/_custom_type_script = "uid://bbey5ttwv5utd" + +[sub_resource type="Resource" id="Resource_215e1"] +script = ExtResource("4_7jktm") +player_name = "Stevie" +player_texture = ExtResource("12_iotsf") +metadata/_custom_type_script = "uid://bbey5ttwv5utd" + +[sub_resource type="Resource" id="Resource_7sc4i"] +script = ExtResource("4_7jktm") +player_name = "Dave" +player_position = 1 player_texture = ExtResource("3_fc0e3") metadata/_custom_type_script = "uid://bbey5ttwv5utd" +[sub_resource type="Resource" id="Resource_80cx4"] +script = ExtResource("4_7jktm") +player_name = "Brendan" +player_position = 2 +player_texture = ExtResource("14_215e1") +metadata/_custom_type_script = "uid://bbey5ttwv5utd" + [node name="Game" type="Node2D" unique_id=980666470] script = ExtResource("1_7jktm") [node name="Court" parent="." unique_id=1870443472 instance=ExtResource("1_e2o6t")] +position = Vector2(420, 0) -[node name="Player" parent="." unique_id=1267043713 instance=ExtResource("2_feb5d")] +[node name="BlueTeam" type="Node2D" parent="." unique_id=1262034555] +position = Vector2(420, 0) +script = ExtResource("3_hve3p") +attributes = SubResource("Resource_lc2xo") +metadata/_custom_type_script = "uid://vb7lr6djyhnv" + +[node name="Blue1" parent="BlueTeam" unique_id=1267043713 instance=ExtResource("2_feb5d")] position = Vector2(548, 648) attributes = SubResource("Resource_ryrav") +[node name="Blue2" parent="BlueTeam" unique_id=1850933619 instance=ExtResource("2_feb5d")] +position = Vector2(278, 562) +attributes = SubResource("Resource_mfdv2") + +[node name="Blue3" parent="BlueTeam" unique_id=75794271 instance=ExtResource("2_feb5d")] +position = Vector2(824, 558) +attributes = SubResource("Resource_iotsf") + +[node name="RedTeam" parent="." unique_id=1449767365 instance=ExtResource("11_mfdv2")] +position = Vector2(420, 0) + +[node name="Red1" parent="RedTeam" unique_id=1614241571 instance=ExtResource("2_feb5d")] +position = Vector2(547, 565) +attributes = SubResource("Resource_215e1") + +[node name="Red2" parent="RedTeam" unique_id=812999974 instance=ExtResource("2_feb5d")] +position = Vector2(369, 461) +attributes = SubResource("Resource_7sc4i") + +[node name="Red3" parent="RedTeam" unique_id=142493116 instance=ExtResource("2_feb5d")] +position = Vector2(700, 416) +attributes = SubResource("Resource_80cx4") + [node name="Ball" parent="." unique_id=1245529605 instance=ExtResource("6_ryrav")] -position = Vector2(559, 656) +position = Vector2(420, 656) diff --git a/player.tscn b/player.tscn index a22c8c1..33537ef 100644 --- a/player.tscn +++ b/player.tscn @@ -12,3 +12,18 @@ texture = ExtResource("1_4flbx") [node name="PlayerNav" type="NavigationAgent2D" parent="." unique_id=1205813043] avoidance_enabled = true debug_enabled = true + +[node name="PlayerNameLabel" type="Label" parent="." unique_id=1663612244] +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -48.0 +offset_top = 24.0 +offset_right = 47.0 +offset_bottom = 47.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "PlayerName" +horizontal_alignment = 1 diff --git a/project.godot b/project.godot index 70c5f9f..6a020fb 100644 --- a/project.godot +++ b/project.godot @@ -17,7 +17,7 @@ config/icon="res://icon.svg" [display] -window/size/viewport_width=1080 +window/size/viewport_width=1920 window/size/viewport_height=1080 [physics] diff --git a/scripts/court.gd b/scripts/court.gd index 6dd5e44..093df10 100644 --- a/scripts/court.gd +++ b/scripts/court.gd @@ -1,2 +1,3 @@ +@icon("res://assets/icons/court.svg") class_name Court extends Node2D diff --git a/scripts/player_attributes.gd b/scripts/custom resources/player_attributes.gd similarity index 98% rename from scripts/player_attributes.gd rename to scripts/custom resources/player_attributes.gd index bc3cad6..c653c9d 100644 --- a/scripts/player_attributes.gd +++ b/scripts/custom resources/player_attributes.gd @@ -5,14 +5,14 @@ extends Resource @export var player_name: String @export_range(0.0, 99.0, 1.0, "prefer_slider") var player_number: int @export var player_position: PlayerPosition -@export_category("Abilities") -@export var speed: float @export_category("Texture") @export var player_texture: Texture2D +@export_category("Abilities") +@export var speed: float ## The court positions available enum PlayerPosition { Guard, + Wing, Big, - Wing } diff --git a/scripts/player_attributes.gd.uid b/scripts/custom resources/player_attributes.gd.uid similarity index 100% rename from scripts/player_attributes.gd.uid rename to scripts/custom resources/player_attributes.gd.uid diff --git a/scripts/custom resources/team_attributes.gd b/scripts/custom resources/team_attributes.gd new file mode 100644 index 0000000..766827e --- /dev/null +++ b/scripts/custom resources/team_attributes.gd @@ -0,0 +1,5 @@ +class_name TeamAttributes +extends Resource + +@export var team_name: String +@export_color_no_alpha var team_color: Color diff --git a/scripts/custom resources/team_attributes.gd.uid b/scripts/custom resources/team_attributes.gd.uid new file mode 100644 index 0000000..6765069 --- /dev/null +++ b/scripts/custom resources/team_attributes.gd.uid @@ -0,0 +1 @@ +uid://c7dxj0ifl687s diff --git a/scripts/player.gd b/scripts/player.gd index 28bd70a..a13103b 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -1,4 +1,5 @@ @icon("res://assets/icons/player.svg") +@tool class_name Player extends Node2D @@ -6,9 +7,13 @@ extends Node2D @export var attributes: PlayerAttributes ## The attributes resource that defines the player's abilities, vitals etc. ## 'onready' variables +@onready var player_name_label: Label = $PlayerNameLabel @onready var player_nav: NavigationAgent2D = $PlayerNav @onready var player_sprite: Sprite2D = $PlayerSprite func _ready() -> void: if attributes: - player_sprite.texture = attributes.player_texture + if attributes.player_name: + player_name_label.text = attributes.player_name + if attributes.player_texture: + player_sprite.texture = attributes.player_texture diff --git a/scripts/team.gd b/scripts/team.gd new file mode 100644 index 0000000..296cbf7 --- /dev/null +++ b/scripts/team.gd @@ -0,0 +1,4 @@ +class_name Team +extends Node2D + +@export var attributes: TeamAttributes diff --git a/scripts/team.gd.uid b/scripts/team.gd.uid new file mode 100644 index 0000000..11183ea --- /dev/null +++ b/scripts/team.gd.uid @@ -0,0 +1 @@ +uid://vb7lr6djyhnv diff --git a/team.tscn b/team.tscn new file mode 100644 index 0000000..4859953 --- /dev/null +++ b/team.tscn @@ -0,0 +1,6 @@ +[gd_scene format=3 uid="uid://cfq463kejcp2m"] + +[ext_resource type="Script" uid="uid://vb7lr6djyhnv" path="res://scripts/team.gd" id="1_hkunw"] + +[node name="Team" type="Node2D" unique_id=1449767365] +script = ExtResource("1_hkunw")