forked from team-sg/hero-mark-2
fixed roboturret turning when seeing blocks
This commit is contained in:
parent
1c232945dc
commit
519670e0cd
2 changed files with 8 additions and 7 deletions
|
@ -18,6 +18,7 @@ func _ready():
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
if raycast.is_colliding():
|
if raycast.is_colliding():
|
||||||
|
if raycast.get_collider().is_in_group("player_hitbox"):
|
||||||
if sign(shootpos.position.x) == -1:
|
if sign(shootpos.position.x) == -1:
|
||||||
anims.play("turn right")
|
anims.play("turn right")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -106,7 +106,7 @@ tracks/2/keys = {
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=5]
|
[sub_resource type="RectangleShape2D" id=5]
|
||||||
extents = Vector2( 4, 4 )
|
extents = Vector2( 2, 3 )
|
||||||
|
|
||||||
[sub_resource type="Animation" id=6]
|
[sub_resource type="Animation" id=6]
|
||||||
resource_name = "eye hue"
|
resource_name = "eye hue"
|
||||||
|
@ -156,13 +156,13 @@ autostart = true
|
||||||
position = Vector2( 3, 3 )
|
position = Vector2( 3, 3 )
|
||||||
enabled = true
|
enabled = true
|
||||||
cast_to = Vector2( 48, 0 )
|
cast_to = Vector2( 48, 0 )
|
||||||
collision_mask = 8
|
collision_mask = 10
|
||||||
collide_with_areas = true
|
collide_with_areas = true
|
||||||
|
|
||||||
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||||
position = Vector2( 4, 4 )
|
position = Vector2( 3, 5 )
|
||||||
shape = SubResource( 5 )
|
shape = SubResource( 5 )
|
||||||
|
|
||||||
[node name="EyeAnim" type="AnimationPlayer" parent="."]
|
[node name="EyeAnim" type="AnimationPlayer" parent="."]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue