ai adaptation

This commit is contained in:
Jonas Mucke
2020-04-20 13:15:24 +02:00
parent b8b026d063
commit 3ec908f6c3
12 changed files with 399 additions and 93 deletions

View File

@@ -4,7 +4,7 @@ class_name Player
This is an example player controller script created by Paul
"""
var velocity := Vector2.ZERO
var rollvector := Vector2.ZERO
var rollvector := Vector2(-1,0)
# This is how you export variables with ranges to the editor window
export(bool) var debug := false
@@ -77,7 +77,7 @@ func _physics_process(delta):
elif movementState == moveState.IDLE:
movement_idle()
else:
movement_run(Vector2(0,0), delta)
movement_run(Vector2.ZERO, delta)
makeMove(delta)
move()
$"Effects/HealEffect".emitting = heal_per_second > 0
@@ -148,9 +148,11 @@ func movement_hit():
func hit_finished():
grid._update_grid()
movementState = moveState.IDLE
ai_movement_state = STEP
ExecutionState = EXECUTING
actionFieldUsed = false
func movement_roll():
@@ -179,15 +181,19 @@ func _on_Hurtbox_area_entered(area):
if area.damage > 0:
damage_per_second += area.damage
pass
else:
heal_per_second += abs(area.damage)
pass
func _on_Hurtbox_area_exited(area):
if area.damage > 0:
damage_per_second -= area.damage
pass
else:
heal_per_second -= abs(area.damage)
pass
func _on_Stats_no_health():

View File

@@ -617,10 +617,10 @@ height = 0.2
[sub_resource type="CapsuleShape2D" id=48]
radius = 4.03497
height = 6.99104
height = 9.42006
[sub_resource type="CircleShape2D" id=51]
radius = 14.7132
radius = 13.3924
[sub_resource type="DynamicFont" id=50]
size = 12
@@ -629,6 +629,7 @@ font_data = ExtResource( 6 )
[node name="Player" type="KinematicBody2D"]
scale = Vector2( 1.1, 1.1 )
script = ExtResource( 1 )
ROLL_SPEED = 120
FRICTION = 270
[node name="Kind" parent="." instance=ExtResource( 7 )]