Compare commits
2 Commits
15b477ca71
...
5f04493981
Author | SHA1 | Date | |
---|---|---|---|
|
5f04493981 | ||
|
b200913a78 |
@ -78,7 +78,7 @@ func move(movement : Vector2):
|
||||
z_index = 100
|
||||
|
||||
|
||||
func attack(damage : int, points : int, pattern : PoolVector2Array): #TODO
|
||||
func attack(damage : int, points : int, pattern : PoolVector2Array):
|
||||
if attack_points != 0:
|
||||
#change animation to attacking
|
||||
$AnimationPlayer.play("Attack front")
|
||||
@ -87,9 +87,10 @@ func attack(damage : int, points : int, pattern : PoolVector2Array): #TODO
|
||||
# and calls their attacked method
|
||||
for i in range(pattern.size()):
|
||||
var coord = Grid.position_to_coordinates(position, height)
|
||||
var selected_name = Grid.grid[coord.x + pattern[i].x][coord.y + pattern[i].y][0]
|
||||
var selected_name = Grid.grid[coord.x + pattern[i].x][coord.y + pattern[i].y]
|
||||
print(coord.x + pattern[i].x, coord.y + pattern[i].y)
|
||||
if selected_name:
|
||||
get_node(("../" + selected_name)).attacked(damage, "") #TODO effects implementation
|
||||
get_node(("../" + selected_name[0])).attacked(damage, "") #TODO effects implementation
|
||||
|
||||
#change the attack points left
|
||||
attack_points = max(attack_points - points, 0) #keep >= 0
|
||||
|
@ -38,7 +38,7 @@ tracks/0/keys = {
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "Attacted"
|
||||
resource_name = "Attacked front"
|
||||
length = 0.8
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
@ -55,7 +55,7 @@ tracks/0/keys = {
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "Attacted back"
|
||||
resource_name = "Attacked back"
|
||||
length = 0.8
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
@ -128,7 +128,7 @@ frame = 12
|
||||
autoplay = "Idle"
|
||||
"anims/Attack back" = SubResource( 1 )
|
||||
"anims/Attack front" = SubResource( 2 )
|
||||
anims/Attacted = SubResource( 3 )
|
||||
"anims/Attacted back" = SubResource( 4 )
|
||||
"anims/Attacked front" = SubResource( 3 )
|
||||
"anims/Attacked back" = SubResource( 4 )
|
||||
anims/Idle = SubResource( 5 )
|
||||
"anims/Idle back" = SubResource( 6 )
|
||||
|
@ -38,7 +38,7 @@ tracks/0/keys = {
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "Attacted"
|
||||
resource_name = "Attacked front"
|
||||
length = 0.8
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
@ -55,7 +55,7 @@ tracks/0/keys = {
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "Attacted back"
|
||||
resource_name = "Attacked back"
|
||||
length = 0.8
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
@ -127,7 +127,7 @@ vframes = 6
|
||||
autoplay = "Idle"
|
||||
"anims/Attack back" = SubResource( 1 )
|
||||
"anims/Attack front" = SubResource( 2 )
|
||||
anims/Attacted = SubResource( 3 )
|
||||
"anims/Attacted back" = SubResource( 4 )
|
||||
"anims/Attacked front" = SubResource( 3 )
|
||||
"anims/Attacked back" = SubResource( 4 )
|
||||
anims/Idle = SubResource( 5 )
|
||||
"anims/Idle back" = SubResource( 6 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user