Mercurial > touhou
changeset 158:7769ce7be03c
Minor cleanup
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 10 Oct 2011 18:56:13 +0200 |
parents | ca6f8b3f739d |
children | 4684d311a32d |
files | pytouhou/formats/ecl.py pytouhou/game/bullet.py pytouhou/game/enemy.py pytouhou/game/player.py pytouhou/opengl/gamerunner.py pytouhou/opengl/texture.py pytouhou/vm/eclrunner.py |
diffstat | 7 files changed, 2 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/pytouhou/formats/ecl.py +++ b/pytouhou/formats/ecl.py @@ -14,7 +14,6 @@ import struct from struct import pack, unpack, calcsize -from pytouhou.utils.helpers import read_string from pytouhou.utils.helpers import get_logger
--- a/pytouhou/game/bullet.py +++ b/pytouhou/game/bullet.py @@ -12,7 +12,7 @@ ## GNU General Public License for more details. ## -from math import cos, sin, atan2, pi +from math import cos, sin, atan2 from pytouhou.utils.interpolator import Interpolator from pytouhou.vm.anmrunner import ANMRunner
--- a/pytouhou/game/enemy.py +++ b/pytouhou/game/enemy.py @@ -14,7 +14,6 @@ from pytouhou.utils.interpolator import Interpolator -from pytouhou.vm.eclrunner import ECLRunner from pytouhou.vm.anmrunner import ANMRunner from pytouhou.game.sprite import Sprite from pytouhou.game.bullet import Bullet
--- a/pytouhou/game/player.py +++ b/pytouhou/game/player.py @@ -13,8 +13,6 @@ ## -from math import cos, sin, atan2, pi - from pytouhou.game.sprite import Sprite from pytouhou.vm.anmrunner import ANMRunner
--- a/pytouhou/opengl/gamerunner.py +++ b/pytouhou/opengl/gamerunner.py @@ -17,9 +17,6 @@ import traceback from pyglet.gl import * -from pytouhou.opengl.texture import TextureManager -from pytouhou.opengl.sprite import get_sprite_rendering_data #TODO: cimport? -from pytouhou.opengl.background import get_background_rendering_data from pytouhou.opengl.gamerenderer import GameRenderer
--- a/pytouhou/opengl/texture.py +++ b/pytouhou/opengl/texture.py @@ -22,6 +22,7 @@ class TextureManager(object): self.loader = loader self.textures = {} + def __getitem__(self, key): if not key in self.textures: self.textures[key] = self.load_texture(key)
--- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -462,9 +462,6 @@ class ECLRunner(object): angle = self._game.prng.rand_double() * (max_angle - min_angle) + min_angle sa, ca = sin(angle), cos(angle) - distx = min(96.0, (maxx - minx) / 2.) - disty = min(96.0, (maxy - miny) / 2.) - if self._enemy.x > maxx - 96.0: ca = -abs(ca) elif self._enemy.x < minx + 96.0: