Beispiel #1
0
 def to_json(self):
     '''
     Serialize the import members of this class as a json object
     '''
     json = EntitySprite.to_json(self)
     json['action_wait_val'] = self.action_wait_val
     json['iters_until_action'] = self.iters_until_action
     json['direction'] = self.direction
     
     return json
Beispiel #2
0
    def to_json(self):
        '''
        Serialize the important members of this class as a json object.
        '''
        json = EntitySprite.to_json(self)
        json['health'] = self.health
        if self.item:
            json['item'] = self.item.name
        else:
            json['item'] = 'None'

        return json