deleting bot

when is shoot
This commit is contained in:
Moonshrike 2021-11-17 23:34:37 +02:00
parent 10e37ac1c2
commit d944bbf380
7 changed files with 17 additions and 12 deletions

View File

@ -30,5 +30,8 @@ func _process(delta):
position += velocity * speed_hyper * delta
func _on_hitbox_body_entered(_body):
func _on_hitbox_body_entered(body):
queue_free()
if body.is_in_group('bot'):
body.queue_free()

View File

@ -22,8 +22,9 @@ func _process(delta):
position += velocity * speed_line * delta
func _on_hitbox_body_entered(_body):
func _on_hitbox_body_entered(body):
queue_free()
if body.is_in_group('bot'):
body.queue_free()

View File

@ -29,5 +29,8 @@ func _process(delta):
position += velocity * speed_parab * delta
func _on_hitbox_body_entered(_body):
func _on_hitbox_body_entered(body):
queue_free()
if body.is_in_group('bot'):
body.queue_free()

View File

@ -23,3 +23,6 @@ func _on_hitbox_body_entered(body):
if body.is_in_group("mobs"):
body.queue_free()
queue_free()
if body.is_in_group('bot'):
body.queue_free()

View File

@ -96,4 +96,4 @@ func shoot_bot():
var b = bullet.instance()
get_parent().add_child(b)
b.global_position = self.global_position
b.global_rotation = 360/rotationAmount
b.global_rotation = self.global_rotation#360/rotationAmount

View File

@ -7,15 +7,11 @@
radius = 9.85811
height = 35.0082
[node name="player_character_bullet" type="Sprite" groups=[
"Net",
]]
[node name="player_character_bullet" type="Sprite" groups=["Net"]]
texture = ExtResource( 1 )
script = ExtResource( 2 )
[node name="hitbox" type="Area2D" parent="." groups=[
"Player_damager",
]]
[node name="hitbox" type="Area2D" parent="." groups=["Player_damager"]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"]
position = Vector2( 10.8253, -0.381073 )

View File

@ -17,7 +17,6 @@ func follow_line_trajectory():
func _process(delta):
print(bot_rotation)
follow_line_trajectory()
time += delta
position += velocity * speed_line * delta