Kovak / CBL_SECRET_PROTOTYPE_RUNNING_GAME

0 stars 0 forks source link

Strange code in PlayerCharacter._advance_time #41

Open sbrother opened 11 years ago

sbrother commented 11 years ago

While fixing some bugs I found this code:

if is_on_ground and 17 <= self.texture.id <= 20 and self.drop_plat == True and self.current_plat_height > 150:
            self.exec_move('drop_platform')

This seems to determine whether or not a character is dropping by checking the ID of the current texture? While it works right now, we should probably fix this before going to much further forward, since if we change the way that textures are imported (or even which textures are imported) in the future (e.g. switching to atlases, or whatever), it will break the dropping code in a way that will seem inexplicable at the time. We should be able to figure out a way to accomplish the same functionality without hardcoding texture ids into _advance_time.