A team game with an emphasis on movement (with no shooting), inspired by Overwatch and Zineth
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
829 B

  1. extends StaticBody
  2. var maker_node
  3. var material
  4. var destroy_cost = 20
  5. func _ready():
  6. get_node("CollisionShape").disabled = true
  7. func init(maker):
  8. maker_node = maker
  9. material = get_node("MeshInstance").get_surface_material(0)
  10. if not material:
  11. material = SpatialMaterial.new()
  12. get_node("MeshInstance").set_surface_material(0, material)
  13. material.flags_transparent = true
  14. material.albedo_color.a = 0.5
  15. func place():
  16. # Originally, the ghost is disabled to avoid weird physics
  17. get_node("CollisionShape").disabled = false
  18. material.flags_transparent = false
  19. sync func destroy():
  20. maker_node.placement.remove_placed(get_name())
  21. func make_last():
  22. material.flags_transparent = true
  23. material.albedo_color.a = 0.9
  24. func out_of_range():
  25. material.albedo_color.a = 0.2
  26. func within_range():
  27. material.albedo_color.a = 0.5