This repository has been archived on 2022-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
Tyra/scripts/Balle.gd

17 lines
411 B
GDScript3
Raw Normal View History

2021-04-07 18:15:41 +02:00
extends Area2D
var vitesseBalle = 700
func _ready():
pass
2021-04-08 03:02:23 +02:00
func _physics_process(delta): # déplacement de la balle
2021-04-07 18:15:41 +02:00
position += transform.x * vitesseBalle * delta
func _on_Area2D_body_entered(body):
2021-04-08 03:02:23 +02:00
if "Murs" in body.name: # supprime la balle quand elle percute un mur
2021-04-07 18:15:41 +02:00
queue_free()
2021-04-08 03:02:23 +02:00
if "Ennemi" in body.name: # supprime l'ennemi et la balle quand le joueur touche qq1
2021-04-07 18:15:41 +02:00
queue_free()
body.queue_free()