How to Convert delta into int value

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Pratik

Hey guys , I am trying to convert delta into a int value for my score system …score should increase with time but when i am trying to convert delta into a int value it always remain same at 0 but works when no change is made to it

func _process(delta):
$Score.text = str(score)
if pause != true:
	var d = delta * 1.0
	score += int(d)
:bust_in_silhouette: Reply From: GameVisitor
delta

is in the range of 0.0166…

delta*1.0 stays in the same range.
int(d) → it will round to closest integer => 0 !

You need to multiply it by 100 or 1000 (depending on your needs)

Thanks man for replying …i tried many things with delta for score but nothing worked so i added a timer to main scene and on timeout added a score anyway but thanks for replying …i will try to see how to do it with delta later

Pratik | 2018-08-15 08:40