bomb_spawner.gd 319 B

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