Mercurial > touhou
comparison pytouhou/game/game.py @ 229:5afc75f71fed
Add “SHT” support to EoSD, and do a little cleanup.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 30 Dec 2011 18:37:06 +0100 |
parents | 31460b2ec530 |
children | 77b83064b57e |
comparison
equal
deleted
inserted
replaced
228:8f4cd1c01d22 | 229:5afc75f71fed |
---|---|
241 | 241 |
242 #TODO: is it the right place? | 242 #TODO: is it the right place? |
243 if py < 128 and player.state.power >= 128: #TODO: check py. | 243 if py < 128 and player.state.power >= 128: #TODO: check py. |
244 self.autocollect(player) | 244 self.autocollect(player) |
245 | 245 |
246 half_size = player.sht.item_hitbox / 2. | |
246 for item in self.items: | 247 for item in self.items: |
247 half_size = item.hitbox_half_size | |
248 bx, by = item.x, item.y | 248 bx, by = item.x, item.y |
249 bx1, bx2 = bx - half_size, bx + half_size | 249 bx1, bx2 = bx - half_size, bx + half_size |
250 by1, by2 = by - half_size, by + half_size | 250 by1, by2 = by - half_size, by + half_size |
251 | 251 |
252 if not (bx2 < px1 or bx1 > px2 | 252 if not (bx2 < px1 or bx1 > px2 |