Skip to content

Commit

Permalink
display version #100
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuafolkken committed Sep 14, 2024
1 parent 09e0fad commit bffd7a8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config_version=5
[application]

config/name="Tic Tac toe"
config/version = "0.100.0"
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
Expand Down
7 changes: 7 additions & 0 deletions scenes/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ text = "X wins!"
horizontal_alignment = 1
vertical_alignment = 1

[node name="VersionLabel" type="Label" parent="UIManager"]
offset_left = 30.0
offset_top = 554.0
offset_right = 115.0
offset_bottom = 574.0
text = "Ver 0.1.2"

[node name="InputHandler" type="Node" parent="."]
script = ExtResource("8_0kf00")
3 changes: 0 additions & 3 deletions src/click_sound.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ func _process(_delta: float) -> void:


func play_cross() -> void:
Log.d("cross")
set_pitch_scale(1.20)
play()


func play_circle() -> void:
Log.d("circle")
set_pitch_scale(0.60)
play()


func play_reset() -> void:
Log.d("reset")
set_pitch_scale(0.30)
play()

Expand Down
1 change: 0 additions & 1 deletion src/game_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func _update_board_history(board_position: BoardPosition) -> Array[BoardPosition

func _update_game_state() -> void:
if not _check_game_end():
Log.d("change!")
_current_player = _current_player.next()
emit_player_changed()

Expand Down
3 changes: 3 additions & 0 deletions src/settings.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class_name Settings

static var version: String = ProjectSettings.get_setting("application/config/version")
2 changes: 2 additions & 0 deletions src/ui_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var _cell_collection := CellCollection.new()
@onready var _cells := $Cells
@onready var _status_label: Label = $StatusLabel
@onready var _reset_button: Button = $ResetButton
@onready var _version_label: Label = $VersionLabel


func _initialize_cells() -> void:
Expand All @@ -17,6 +18,7 @@ func _initialize_cells() -> void:

func _ready() -> void:
_initialize_cells()
_version_label.text = "Ver %s" % Settings.version


func update_cell(position: BoardPosition, status: CellStatus) -> void:
Expand Down

0 comments on commit bffd7a8

Please sign in to comment.