No Description
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.

foreground.gd 483B

123456789101112131415161718192021222324
  1. extends Node2D
  2. onready var texture : TextureRect = $TextureRect
  3. var force_stop = false
  4. var moving = false
  5. func stop():
  6. moving = false
  7. force_stop = true
  8. texture.material.set_shader_param("scroll_speed", 0)
  9. func start():
  10. moving = true
  11. force_stop = false
  12. texture.material.set_shader_param("scroll_speed", 0.2)
  13. func _process(delta):
  14. if not force_stop:
  15. if get_tree().paused and moving:
  16. stop()
  17. force_stop = false
  18. elif not get_tree().paused and not moving:
  19. start()