It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
20
Utils/PlayOnReady.gd
Normal file
20
Utils/PlayOnReady.gd
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
extends AnimatedSprite2D
|
||||
|
||||
@export var randDelayMin:float = 0
|
||||
@export var randDelayMax:float = 0
|
||||
|
||||
var delayLeft = 0
|
||||
|
||||
var rng = RandomNumberGenerator.new()
|
||||
|
||||
func _ready():
|
||||
if randDelayMax <= 0:
|
||||
play()
|
||||
else:
|
||||
delayLeft = rng.randf_range(randDelayMin, randDelayMax)
|
||||
|
||||
func _process(delta):
|
||||
if delayLeft > 0:
|
||||
delayLeft -= delta
|
||||
if delayLeft <= 0:
|
||||
play()
|
||||
28
Utils/TimeDisplayUtils.gd
Normal file
28
Utils/TimeDisplayUtils.gd
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
extends Node
|
||||
|
||||
class_name TimeDisplayUtils
|
||||
|
||||
const secondsInHour = 3600
|
||||
|
||||
static func get_time_string(time):
|
||||
var hours = int(time)/int(secondsInHour)
|
||||
time -= hours*secondsInHour
|
||||
|
||||
var minutes = int(time)/int(60)
|
||||
time -= minutes*60
|
||||
|
||||
var resultString = ""
|
||||
|
||||
if hours > 0:
|
||||
resultString += str(hours) + "h"
|
||||
|
||||
if minutes > 0:
|
||||
if resultString != "":
|
||||
resultString += " "
|
||||
resultString += str(minutes) + "m"
|
||||
|
||||
if resultString != "":
|
||||
resultString += " "
|
||||
resultString += str(time) + "s"
|
||||
|
||||
return resultString
|
||||
12
Utils/XpDisplayUtils.gd
Normal file
12
Utils/XpDisplayUtils.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
extends RefCounted
|
||||
|
||||
class_name XpDisplayUtils
|
||||
|
||||
static func xpFormater(xpAmount:int, dropFirstDigit:bool = false):
|
||||
var firstDigit = xpAmount % 10
|
||||
var otherDigits = xpAmount / 10
|
||||
|
||||
if dropFirstDigit:
|
||||
return str(otherDigits)
|
||||
|
||||
return str(otherDigits) + "." + str(firstDigit)
|
||||
Loading…
Add table
Add a link
Reference in a new issue