@@ -19,11 +19,11 @@ class Clock:
19
19
only certain elements rather than everything.
20
20
21
21
Args:
22
- initial_elapsed (float, optional) : The amount of time the clock should assume has
22
+ initial_elapsed: The amount of time the clock should assume has
23
23
already occurred. Defaults to 0.0
24
- initial_tick (int, optional) : The number of ticks the clock should assume has already
24
+ initial_tick: The number of ticks the clock should assume has already
25
25
occurred. Defaults to 0.
26
- tick_speed (float, optional) : A multiplier on how the 'speed' of time.
26
+ tick_speed: A multiplier on how the 'speed' of time.
27
27
i.e. a value of 0.5 means time elapsed half as fast for this clock. Defaults to 1.0.
28
28
"""
29
29
@@ -40,7 +40,7 @@ def tick(self, delta_time: float):
40
40
Update the clock with the time that has passed since the last tick.
41
41
42
42
Args:
43
- delta_time (float) : The amount of time that has passed since the last tick.
43
+ delta_time: The amount of time that has passed since the last tick.
44
44
"""
45
45
self ._tick_delta_time = delta_time * self ._tick_speed
46
46
self ._elapsed_time += self ._tick_delta_time
@@ -51,7 +51,7 @@ def set_tick_speed(self, new_tick_speed: float):
51
51
Set the speed of time for this clock.
52
52
53
53
Args:
54
- new_tick_speed (float) : A multiplier on the 'speed' of time.
54
+ new_tick_speed: A multiplier on the 'speed' of time.
55
55
i.e. a value of 0.5 means time elapsed half as fast for this clock.
56
56
"""
57
57
self ._tick_speed = new_tick_speed
@@ -61,7 +61,7 @@ def time_since(self, time: float) -> float:
61
61
Calculate the amount of time that has passed since the given time.
62
62
63
63
Args:
64
- time (float) : The time to compare against.
64
+ time: The time to compare against.
65
65
"""
66
66
return self ._elapsed_time - time
67
67
@@ -70,7 +70,7 @@ def ticks_since(self, tick: int) -> int:
70
70
Calculate the number of ticks that have occurred since the given tick.
71
71
72
72
Args:
73
- tick (int) : The tick to compare against.
73
+ tick: The tick to compare against.
74
74
"""
75
75
return self ._tick - tick
76
76
@@ -123,8 +123,8 @@ class FixedClock(Clock):
123
123
Arcade provides a global fixed clock which is automatically ticked every update
124
124
125
125
Args:
126
- sibling (Clock) : The unfixed clock which this clock will sync with.
127
- fixed_tick_rate (float, optional) : The fixed number of seconds that pass
126
+ sibling: The unfixed clock which this clock will sync with.
127
+ fixed_tick_rate: The fixed number of seconds that pass
128
128
for this clock every tick. Defaults to ``1.0 / 60.0``.
129
129
"""
130
130
@@ -138,7 +138,7 @@ def set_tick_speed(self, new_tick_speed: float):
138
138
Set the speed of time for this clock.
139
139
140
140
Args:
141
- new_tick_speed (float) : A multiplier on the 'speed' of time.
141
+ new_tick_speed: A multiplier on the 'speed' of time.
142
142
i.e. a value of 0.5 means time elapsed half as fast for this clock
143
143
"""
144
144
raise ValueError (
@@ -150,7 +150,7 @@ def tick(self, delta_time: float):
150
150
Update the clock with the time that has passed since the last tick.
151
151
152
152
Args:
153
- delta_time (float) : The amount of time that has passed since the last tick.
153
+ delta_time: The amount of time that has passed since the last tick.
154
154
"""
155
155
if delta_time != self ._fixed_rate :
156
156
raise ValueError (
@@ -184,11 +184,11 @@ def _setup_clock(initial_elapsed: float = 0.0, initial_tick: int = 0, tick_speed
184
184
Private method used by the arcade window to setup the global clock post initialization.
185
185
186
186
Args:
187
- initial_elapsed (float, optional) : The amount of time the clock should assume
187
+ initial_elapsed: The amount of time the clock should assume
188
188
has already occurred. Defaults to 0.0
189
- initial_tick (int, optional) : The number of ticks the clock should assume has
189
+ initial_tick: The number of ticks the clock should assume has
190
190
already occurred. Defaults to 0.
191
- tick_speed (float, optional) : A multiplier on the 'speed' of time.
191
+ tick_speed: A multiplier on the 'speed' of time.
192
192
i.e. a value of 0.5 means time elapsed half as fast for this clock.
193
193
Defaults to 1.0.
194
194
"""
@@ -203,7 +203,7 @@ def _setup_fixed_clock(fixed_tick_rate: float = 1.0 / 60.0):
203
203
post initialization.
204
204
205
205
Args:
206
- fixed_tick_rate (float, optional) : The fixed number of seconds that pass
206
+ fixed_tick_rate: The fixed number of seconds that pass
207
207
for this clock every tick. Defaults to 1.0 / 60.0
208
208
"""
209
209
GLOBAL_FIXED_CLOCK ._elapsed_time = GLOBAL_CLOCK .time # noqa: SLF001
0 commit comments