add boss enemy and refactor
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
extends Area2D
|
||||
|
||||
@export var animation_player: AnimationPlayer
|
||||
@export var animation_name: String
|
||||
|
||||
@export var animated_sprite: AnimatedSprite2D
|
||||
@export var animated_sprite_name: String
|
||||
|
||||
@export var player_bounce: int
|
||||
|
||||
signal hit
|
||||
|
||||
func _on_body_entered(player_body: Node2D) -> void:
|
||||
var player_character_body = player_body as CharacterBody2D
|
||||
player_character_body.velocity.y = player_bounce
|
||||
hit.emit()
|
||||
|
||||
animated_sprite.play(animated_sprite_name)
|
||||
animation_player.play(animation_name)
|
||||
|
||||
Reference in New Issue
Block a user