""" for tree_birds / Apple tree - bird feedind: food that has effects, affects the eater. now can either make grow, or fertilize. these all are apples but different colours, ok?-) """ import soya class Apple(soya.World): """this used to be in appletree but was moved here to be the base""" material = soya.Material() material.shininess = 64 material.diffuse = (1.0, 0.2, 0.0, 1.0) material.specular = (0.8, 1.0, 1.0, 1.0) def __init__(self, parent, pos): soya.World.__init__(self, parent) self.sphere = soya.sphere.Sphere(self, material=self.material, insert_into=self, slices=10, stacks=10, smooth_lit=True) self.move(pos) self.set_dimension(0.2, 0.2, 0.2) class GrowthApple(Apple): material = soya.Material() material.shininess = 32 material.diffuse = (0.7, 0.8, 0.0, 1.0) material.specular = (0.6, 0.4, 0.5, 1.0) def affect(self, eater): eater.grow() class FertilizingApple(Apple): material = soya.Material() material.shininess = 64 material.diffuse = (1.0, 0.2, 0.0, 1.0) material.specular = (0.8, 1.0, 1.0, 1.0) def affect(self, eater): eater.fertilize()