Browse Source

reset snake speed on restart

Thomas Buck 1 year ago
parent
commit
4b49c4f200
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      snake.py

+ 2
- 1
snake.py View File

17
         self.gui = g
17
         self.gui = g
18
         self.input = i
18
         self.input = i
19
         self.colors = [ bg, sc, d ]
19
         self.colors = [ bg, sc, d ]
20
-        self.timestep = ts
20
+        self.timestepOriginal = ts
21
         self.timeout = to
21
         self.timeout = to
22
         self.speedup = su
22
         self.speedup = su
23
 
23
 
35
         self.restart()
35
         self.restart()
36
 
36
 
37
     def restart(self):
37
     def restart(self):
38
+        self.timestep = self.timestepOriginal
38
         self.start = time.time()
39
         self.start = time.time()
39
         self.last = time.time()
40
         self.last = time.time()
40
         self.direction = "r"
41
         self.direction = "r"

Loading…
Cancel
Save