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,10 +18,11 @@ func _ready():
|
|||
|
||||
func _physics_process(delta):
|
||||
if raycast.is_colliding():
|
||||
if sign(shootpos.position.x) == -1:
|
||||
anims.play("turn right")
|
||||
else:
|
||||
anims.play("turn left")
|
||||
if raycast.get_collider().is_in_group("player_hitbox"):
|
||||
if sign(shootpos.position.x) == -1:
|
||||
anims.play("turn right")
|
||||
else:
|
||||
anims.play("turn left")
|
||||
#Do not charge up offscreen
|
||||
if Game.get_sector(position) != Game.current_sector: timer.start()
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ tracks/2/keys = {
|
|||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=5]
|
||||
extents = Vector2( 4, 4 )
|
||||
extents = Vector2( 2, 3 )
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
resource_name = "eye hue"
|
||||
|
@ -156,13 +156,13 @@ autostart = true
|
|||
position = Vector2( 3, 3 )
|
||||
enabled = true
|
||||
cast_to = Vector2( 48, 0 )
|
||||
collision_mask = 8
|
||||
collision_mask = 10
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 4, 4 )
|
||||
position = Vector2( 3, 5 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="EyeAnim" type="AnimationPlayer" parent="."]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue