Added shield damage taken indicator to colliding with enemies; added
shaders to experiment with (disabled)
This commit is contained in:
parent
bfe71e4908
commit
3bd16da435
8 changed files with 387 additions and 4 deletions
10
player.gd
10
player.gd
|
|
@ -19,7 +19,8 @@ func _ready():
|
|||
start()
|
||||
|
||||
func start():
|
||||
show()
|
||||
set_process(true)
|
||||
$Ship.show()
|
||||
shield = max_shield
|
||||
position = Vector2(screensize.x / 2, screensize.y - 64)
|
||||
$GunCooldown.wait_time = cooldown
|
||||
|
|
@ -28,7 +29,11 @@ func set_shield(value):
|
|||
shield = min(max_shield, value)
|
||||
shield_changed.emit(max_shield, shield)
|
||||
if shield <= 0:
|
||||
hide()
|
||||
set_process(false)
|
||||
$Ship.hide()
|
||||
$Explosion.show()
|
||||
$Explosion/AnimationPlayer.play("explosion-one-shot")
|
||||
await $Explosion/AnimationPlayer.animation_finished
|
||||
died.emit()
|
||||
|
||||
func shoot():
|
||||
|
|
@ -66,6 +71,7 @@ func _on_area_entered(area):
|
|||
if area.is_in_group("enemies"):
|
||||
area.explode()
|
||||
shield -= max_shield / 2
|
||||
damage_taken.emit()
|
||||
if area.is_in_group("enemy_bullets"):
|
||||
damage_taken.emit()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue