First commit

This commit is contained in:
Michele Rossi
2026-03-08 10:38:30 +01:00
commit bd11d2c037
27 changed files with 707 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
class_name CurrencyGenerator
extends Node
@export var currency: GameState.CurrencyType
@export var data: CurrencyGeneratorData
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_pressed() -> void:
match currency:
GameState.CurrencyType.gold: GameState.add_gold(BigNumber.new(1, 0))
GameState.CurrencyType.gems: GameState.add_gems(BigNumber.new(1, 0))
_: print("c")
pass

View File

@@ -0,0 +1 @@
uid://dtbxopw6ulhl8

View File

@@ -0,0 +1,18 @@
class_name CurrencyGeneratorData
extends Resource
@export var id: GameState.CurrencyType
@export var name: String
@export var initial_cost: float
@export var coefficient: float
@export var initial_time: float
@export var initial_revenue: float
@export var initial_productivity: float
## Returns cost of next generator
func cost_next(owned: int) -> float:
return initial_cost * pow(coefficient, owned)
## Returns value produced
func production_total(owned: int, multipliers: float) -> float:
return (initial_productivity * owned) * multipliers

View File

@@ -0,0 +1 @@
uid://b00tqsuhxdy0d