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
2021-04-08 03:02:23 +02:00

16 lines
411 B
GDScript

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