To accommodate the use of this scaling when the object is being drawn, we must update the Transform class thus:
class Transform:
def_init_(self, position=pygame. Vector3 $(0,0$,
$0)$, scale=pygame. $\operatorname{Vector3}(1,1,1))$ :
self.position $=$ pygame.Vector3 (position)
self.scale $=$ pygame. $\operatorname{Vector3}($ scale $)$
.
def get_scale(self) :
return self.scale
def set_scale(self, amount: pygame.Vector3):
self.scale = amount
This code adds scale as a property of the Trans form class as well as setting default values for the position and scale in the constructor. Note that a scale of 1 will do nothing to the object. At the end of the class, two new methods, get_scale () and set_scale (), are added to allow the scale to be set and retrieved as required.