offender.gd 448 B

12345678910111213141516171819202122
  1. extends RigidBody2D
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. func _ready():
  6. connect("body_entered",self,"on_entered")
  7. pass # Replace with function body.
  8. func on_entered(body):
  9. print("contact with", body, body.name)
  10. if body.name == 'ground':
  11. self.queue_free()
  12. # Called every frame. 'delta' is the el
  13. # Called every frame. 'delta' is the elapsed time since the previous frame.
  14. #func _process(delta):
  15. # pass