Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b52ef06af8 | |||
| b7f0180a96 | |||
| ba1538647e |
30
Scripts/core_manager.gd
Normal file
30
Scripts/core_manager.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
extends Node
|
||||
func _ready ():
|
||||
start_build()
|
||||
var game_time := 0.0 #aktualny czas w grze
|
||||
var build_duration := 10.0
|
||||
var finish_time := 0.0
|
||||
var is_building := false
|
||||
|
||||
func _process(delta):
|
||||
game_time += delta * Settings.time_scale
|
||||
#print(now())
|
||||
|
||||
if is_building:
|
||||
if game_time >= finish_time:
|
||||
finish_building()
|
||||
|
||||
func now() -> float:
|
||||
return game_time
|
||||
|
||||
func start_build():
|
||||
# ustawiamy czas zakończenia budowy na current_time + build_duration
|
||||
finish_time = game_time + build_duration
|
||||
is_building = true
|
||||
print("Budowa rozpoczęta. Zakończy się o czasie:", finish_time)
|
||||
|
||||
|
||||
func finish_building():
|
||||
is_building = false
|
||||
print("Budowa zakończona w czasie gry:", game_time)
|
||||
|
||||
1
Scripts/core_manager.gd.uid
Normal file
1
Scripts/core_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cfp08u5odbrej
|
||||
@@ -4,7 +4,6 @@ var index : float = 0
|
||||
var index_integer = 0
|
||||
@onready var GNN_lenght = get_node ("Label/GIN").get_total_character_count()
|
||||
func _ready():
|
||||
|
||||
# teraz chowamy niepotrzebne teksty
|
||||
$Label/Nazwa_statku.hide()
|
||||
$Label/Nazwa_statku.visible_characters = 0
|
||||
|
||||
4
Scripts/settings.gd
Normal file
4
Scripts/settings.gd
Normal file
@@ -0,0 +1,4 @@
|
||||
extends Node
|
||||
#Opcje konfiguracyjne
|
||||
|
||||
var time_scale := 1 #mnożnik czasu (x1 normalny)
|
||||
1
Scripts/settings.gd.uid
Normal file
1
Scripts/settings.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://45qg56i64o8p
|
||||
0
To jest testowa zmiana.txt
Normal file
0
To jest testowa zmiana.txt
Normal file
@@ -1,4 +1,4 @@
|
||||
[gd_resource type="AudioBusLayout" format=3 uid="uid://clgkeb5hrksja"]
|
||||
[gd_resource type="AudioBusLayout" load_steps=0 format=3 uid="uid://clgkeb5hrksja"]
|
||||
|
||||
[resource]
|
||||
bus/1/name = &"Music"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene format=3 uid="uid://db3qkr4k5gpbh"]
|
||||
[gd_scene load_steps=0 format=3 uid="uid://db3qkr4k5gpbh"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
|
||||
@@ -17,6 +17,8 @@ config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
||||
Settings="*res://Scripts/settings.gd"
|
||||
CoreManager="*res://Scripts/core_manager.gd"
|
||||
BackgroundMusic="*res://sceny/background_music.tscn"
|
||||
|
||||
[internationalization]
|
||||
|
||||
Reference in New Issue
Block a user