they say i'm the best at handling balls
This commit is contained in:
parent
a40347a52f
commit
d3e402bb5b
7 changed files with 137 additions and 0 deletions
27
objects/environment/zball/zball.gd
Normal file
27
objects/environment/zball/zball.gd
Normal file
|
@ -0,0 +1,27 @@
|
|||
extends RigidBody2D
|
||||
|
||||
|
||||
export var max_glow: float = 5.0
|
||||
|
||||
|
||||
onready var glow: Light2D = $Glow
|
||||
|
||||
|
||||
func _on_Hurtbox_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("enemy_hitbox"):
|
||||
var target = area.get_parent()
|
||||
target.die()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var speed: float = inverse_lerp(0.0, 250.0, linear_velocity.length())
|
||||
print(speed)
|
||||
glow.energy = lerp(0.0, max_glow, speed)
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
pass
|
||||
# if glow.energy < max_glow:
|
||||
# pass
|
||||
# glow.energy += glow_increase
|
||||
# smoke_particles.amount += 1
|
Loading…
Add table
Add a link
Reference in a new issue