fixed death cam fov and added damage numbers
This commit is contained in:
34
scripts/DamageNumber.gd
Normal file
34
scripts/DamageNumber.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
extends Label3D
|
||||
|
||||
var damage_amt
|
||||
var start_position
|
||||
|
||||
const SPEED = 2
|
||||
const SCALE_SPEED = 80
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
start_position = position
|
||||
|
||||
var rand_scale = randf_range(.5,1.5)
|
||||
|
||||
scale.x = 1 * rand_scale
|
||||
scale.y = 1 * rand_scale
|
||||
text = str(damage_amt)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
|
||||
|
||||
#scale.x = lerp(0,1,SCALE_SPEED * delta )
|
||||
#scale.y = lerp(0,1,SCALE_SPEED * delta)
|
||||
position.y += SPEED * delta
|
||||
|
||||
var position_diff = clamp((position.y - start_position.y)/5,0,1)
|
||||
|
||||
modulate = Color(1, 1, 1,1 - position_diff)
|
||||
outline_modulate = Color(1, 1, 1, 1 - position_diff)
|
||||
|
||||
if position_diff == 1:
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user