Skip to content

Commit

Permalink
Add my unique id
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-- committed Jan 23, 2024
1 parent 3ca1324 commit 1d7a787
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion circuits/circuit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func _circuit_ready():
if i == Global.my_race_car_idx:
self.my_race_car_id = car.get_instance_id()
car.get_path_direction = null
# car.set_label(":-)")
# car.set_label(Global.my_unique_id)
else:
car.get_path_direction = self.get_path_direction
car.set_label("PC" + str(i+1))
Expand Down
1 change: 1 addition & 0 deletions global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var game_play_mode = null

var race_car_registry: Dictionary = {}
var my_race_car_idx: int = 0
var my_unique_id: String = OS.get_unique_id()

# race car icons
const RACE_CAR_ICONS_SMALL: Array = [
Expand Down
1 change: 1 addition & 0 deletions main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var loaded_curcuit_scene: PackedScene = null

func _ready():
Global.race_car_registry.clear()
$SettingsPanel/HBoxContainer/Label.text = Global.my_unique_id.substr(0, 3)

$Container/CarContainer/GreenButton.init(Global.ICON_RACE_CAR_GREEN)
$Container/CarContainer/OrangeButton.init(Global.ICON_RACE_CAR_ORANGE)
Expand Down
24 changes: 23 additions & 1 deletion main.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[gd_scene load_steps=21 format=2]
[gd_scene load_steps=23 format=2]

[ext_resource path="res://assets/audio/slow_rain.mp3" type="AudioStream" id=1]
[ext_resource path="res://ui/sound_button.tscn" type="PackedScene" id=2]
[ext_resource path="res://main.gd" type="Script" id=3]
[ext_resource path="res://ui/box_button.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/options_button.tscn" type="PackedScene" id=5]
[ext_resource path="res://assets/fonts/Formula1Bold.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://icon.png" type="Texture" id=10]

[sub_resource type="StyleBoxFlat" id=14]
Expand All @@ -28,6 +29,14 @@ corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

[sub_resource type="DynamicFont" id=26]
size = 32
extra_spacing_top = 3
extra_spacing_bottom = 3
extra_spacing_char = 3
extra_spacing_space = 3
font_data = ExtResource( 6 )

[sub_resource type="StyleBoxFlat" id=15]
resource_local_to_scene = true
content_margin_left = 5.0
Expand Down Expand Up @@ -241,6 +250,18 @@ anchor_bottom = 0.0
margin_right = 64.0
margin_bottom = 64.0

[node name="Label" type="Label" parent="SettingsPanel/HBoxContainer"]
margin_left = 470.0
margin_top = 12.0
margin_right = 553.0
margin_bottom = 51.0
size_flags_horizontal = 14
custom_fonts/font = SubResource( 26 )
text = "ABC"
align = 1
valign = 1
uppercase = true

[node name="SoundButton" parent="SettingsPanel/HBoxContainer" instance=ExtResource( 2 )]
margin_left = 979.0
margin_right = 1043.0
Expand Down Expand Up @@ -341,6 +362,7 @@ margin_bottom = 70.0
custom_styles/panel = SubResource( 25 )

[node name="MultiplayerButton" parent="Container/ModeContainer" instance=ExtResource( 4 )]
visible = false
margin_top = 120.0
margin_right = 1080.0
margin_bottom = 130.0
Expand Down

0 comments on commit 1d7a787

Please sign in to comment.