Enemy
made a basic enemy that can harm/kill the player.
This commit is contained in:
1 parent
2315add8ec
commit
bb9682cd16
6 files changed
+117
-4
No files matched your search
@@ -138,7 +138,7 @@ var gravityActive: bool = true
|
||||
var dashing: bool = false
|
||||
var dashCount: int
|
||||
var rolling: bool = false
|
||||
|
||||
var death_counter = 3
|
||||
var twoWayDashHorizontal
|
||||
var twoWayDashVertical
|
||||
var eightWayDash
|
||||
@@ -254,6 +254,8 @@ func _updateData():
|
||||
func _process(_delta):
|
||||
#INFO animations
|
||||
#directions
|
||||
if death_counter == 0:
|
||||
get_tree().quit()
|
||||
if is_on_wall() and !is_on_floor() and latch and wallLatching and ((wallLatchingModifer and latchHold) or !wallLatchingModifer):
|
||||
latched = true
|
||||
else:
|
||||
@@ -325,6 +327,10 @@ func _process(_delta):
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if death_counter == 2:
|
||||
$health/ColorRect3.hide()
|
||||
elif death_counter == 1:
|
||||
$health/ColorRect2.hide()
|
||||
if !dset:
|
||||
gdelta = delta
|
||||
dset = true
|
||||
@@ -674,3 +680,7 @@ func _endGroundPound():
|
||||
|
||||
func _placeHolder():
|
||||
print("")
|
||||
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
death_counter -= 1
|
||||
Reference in new issue
Block a user