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