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