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.

40 lines
877 B

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