@@ -52,7 +52,7 @@ def __init__(self, bar_list: arcade.SpriteList) -> None:
52
52
scale = SPRITE_SCALING_PLAYER ,
53
53
)
54
54
self .indicator_bar : IndicatorBar = IndicatorBar (
55
- self , bar_list , (self .center_x , self .center_y ), scale = 1.5 ,
55
+ self , bar_list , (self .center_x , self .center_y ), scale = ( 1.5 , 1.5 ) ,
56
56
)
57
57
self .health : int = PLAYER_HEALTH
58
58
@@ -98,7 +98,7 @@ def __init__(
98
98
width : int = 100 ,
99
99
height : int = 4 ,
100
100
border_size : int = 4 ,
101
- scale : float = 1.0 ,
101
+ scale : Tuple [ float , float ] = ( 1.0 , 1.0 ) ,
102
102
) -> None :
103
103
# Store the reference to the owner and the sprite list
104
104
self .owner : Player = owner
@@ -110,7 +110,7 @@ def __init__(
110
110
self ._center_x : float = 0.0
111
111
self ._center_y : float = 0.0
112
112
self ._fullness : float = 0.0
113
- self ._scale : float = 1.0
113
+ self ._scale : Tuple [ float , float ] = ( 1.0 , 1.0 )
114
114
115
115
# Create the boxes needed to represent the indicator bar
116
116
self ._background_box : arcade .SpriteSolidColor = arcade .SpriteSolidColor (
@@ -206,8 +206,8 @@ def fullness(self, new_fullness: float) -> None:
206
206
else :
207
207
# Set the full_box to be visible incase it wasn't then update the bar
208
208
self .full_box .visible = True
209
- self .full_box .width = self ._bar_width * new_fullness * self .scale
210
- self .full_box .left = self ._center_x - (self ._bar_width / 2 ) * self .scale
209
+ self .full_box .width = self ._bar_width * new_fullness * self .scale [ 0 ]
210
+ self .full_box .left = self ._center_x - (self ._bar_width / 2 ) * self .scale [ 0 ]
211
211
212
212
@property
213
213
def position (self ) -> Tuple [float , float ]:
@@ -224,15 +224,15 @@ def position(self, new_position: Tuple[float, float]) -> None:
224
224
self .full_box .position = new_position
225
225
226
226
# Make sure full_box is to the left of the bar instead of the middle
227
- self .full_box .left = self ._center_x - (self ._bar_width / 2 ) * self .scale
227
+ self .full_box .left = self ._center_x - (self ._bar_width / 2 ) * self .scale [ 0 ]
228
228
229
229
@property
230
- def scale (self ) -> float :
230
+ def scale (self ) -> Tuple [ float , float ] :
231
231
"""Returns the scale of the bar."""
232
232
return self ._scale
233
233
234
234
@scale .setter
235
- def scale (self , value : float ) -> None :
235
+ def scale (self , value : Tuple [ float , float ] ) -> None :
236
236
"""Sets the new scale of the bar."""
237
237
# Check if the scale has changed. If so, change the bar's scale
238
238
if value != self .scale :
0 commit comments