X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=koperkapel%2Fvehicles%2Fbase.py;h=09090048d5991b449f7a8f2a7c6a0599ae0dbac1;hb=68d330ed4e465c65f3c76366b0909b4a49ecf8c8;hp=27373a5f1eb881c658b2f00021d4e21e5482e65e;hpb=6c6ebfbe8d8cbd476c94a5030bc1ab9e7d858f6d;p=koperkapel.git diff --git a/koperkapel/vehicles/base.py b/koperkapel/vehicles/base.py index 27373a5..0909004 100644 --- a/koperkapel/vehicles/base.py +++ b/koperkapel/vehicles/base.py @@ -1,13 +1,15 @@ """ Base class for vehicles. """ +from pgzero.actor import Actor + class Vehicle: """ Vehicle base class. A vehicle should have the following attributes: - * seats -- list of roach seats. * background -- actor representing background for management scene + * seats -- list of roach seats. """ vehicle_types = {} @@ -30,6 +32,7 @@ class Vehicle: class Seat: """ A space in a vehicle for a roach. + * background -- actor representing the seat. * pos -- (x, y) position of the seat relative to the centre of the vehicle. x and y may be numbers from approximately -1.0 to 1.0. They will be multiplied by the approximate_radius of the vehicle. @@ -37,7 +40,8 @@ class Seat: seat """ - def __init__(self, pos, allowed=None): + def __init__(self, actor, pos, allowed=None): + self.actor = actor self.pos = pos self.allowed = allowed or (lambda roach: True)