bomb_spawner.gd 353 B

123456789101112131415
  1. extends MultiplayerSpawner
  2. func _init() -> void:
  3. spawn_function = _spawn_bomb
  4. func _spawn_bomb(data: Array) -> Area2D:
  5. if data.size() != 2 or typeof(data[0]) != TYPE_VECTOR2 or typeof(data[1]) != TYPE_INT:
  6. return null
  7. var bomb: Area2D = preload("res://bomb.tscn").instantiate()
  8. bomb.position = data[0]
  9. bomb.from_player = data[1]
  10. return bomb