Return the number of army glyphs either colliding with the player or hitting the bottom of the screen. The player loses if this is non-zero.
(session, state)
| 483 | |
| 484 | |
| 485 | def check_lose(session, state): |
| 486 | """Return the number of army glyphs either colliding |
| 487 | with the player or hitting the bottom of the screen. |
| 488 | |
| 489 | The player loses if this is non-zero.""" |
| 490 | |
| 491 | player = state["player"] |
| 492 | return ( |
| 493 | session.query(GlyphCoordinate) |
| 494 | .join(GlyphCoordinate.glyph.of_type(ArmyGlyph)) |
| 495 | .filter( |
| 496 | GlyphCoordinate.intersects(player) | GlyphCoordinate.bottom_bound |
| 497 | ) |
| 498 | .count() |
| 499 | ) |
| 500 | |
| 501 | |
| 502 | def render_message(session, window, msg, x, y): |
no test coverage detected