This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def check_for_flow(self): | |
| if self.terrain_type == 'grass': | |
| return False | |
| neighbors = engine.metagrid.get_neighbors(self.pos) | |
| did_flow = False | |
| for direction in ORDINALS: | |
| these_neighbors = neighbors.get(direction) or {} | |
| ground_neighbor = these_neighbors.get(LAYER_GROUND) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # fixed way | |
| def check_for_flow(self): | |
| if self.terrain_type == 'grass': | |
| return False | |
| neighbors = engine.metagrid.get_neighbors(self.pos) | |
| flow_dirs = [] | |
| for direction in ORDINALS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def hokey_pokey(self): | |
| for appendage in [ "left_hand", | |
| "right_hand", | |
| "left_foot", | |
| "right_foot", | |
| "whole_head"] : | |
| self.put_in(getattr(self,appendage)) | |
| self.take_out(getattr(self,appendage)) | |
| self.shake_about(getattr(self,appendage)) | |
| # it's not really recursive. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| from PIL import ImageDraw | |
| import lazyopt | |
| import random | |
| import os | |
| this_dir = os.getcwd() | |
| images_dir = os.path.join(this_dir,'images') |
NewerOlder