Browse Source

Small fixes

pull/54/head
Jure Šorn 4 years ago
parent
commit
9943ca7a0e
3 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html
  3. BIN
      web/mario_bros.png

2
README.md

@ -3056,7 +3056,7 @@ def draw(screen, images, mario, tiles, pressed):
mario.facing_left = (D.w in pressed) if {D.e, D.w} & pressed else mario.facing_left
screen.blit(images[get_frame_index() + mario.facing_left * 9], mario.rect)
for rect in tiles:
screen.blit(images[19 if {*rect.topleft} & {0, (SIZE-1)*16} else 18], rect)
screen.blit(images[18 if {*rect.topleft} & {0, (SIZE-1)*16} else 19], rect)
pygame.display.flip()
if __name__ == '__main__':

2
index.html

@ -2603,7 +2603,7 @@ SIZE, MAX_SPEED = <span class="hljs-number">50</span>, P(<span class="hljs-numbe
mario.facing_left = (D.w <span class="hljs-keyword">in</span> pressed) <span class="hljs-keyword">if</span> {D.e, D.w} &amp; pressed <span class="hljs-keyword">else</span> mario.facing_left
screen.blit(images[get_frame_index() + mario.facing_left * <span class="hljs-number">9</span>], mario.rect)
<span class="hljs-keyword">for</span> rect <span class="hljs-keyword">in</span> tiles:
screen.blit(images[<span class="hljs-number">19</span> <span class="hljs-keyword">if</span> {*rect.topleft} &amp; {<span class="hljs-number">0</span>, (SIZE<span class="hljs-number">-1</span>)*<span class="hljs-number">16</span>} <span class="hljs-keyword">else</span> <span class="hljs-number">18</span>], rect)
screen.blit(images[<span class="hljs-number">18</span> <span class="hljs-keyword">if</span> {*rect.topleft} &amp; {<span class="hljs-number">0</span>, (SIZE<span class="hljs-number">-1</span>)*<span class="hljs-number">16</span>} <span class="hljs-keyword">else</span> <span class="hljs-number">19</span>], rect)
pygame.display.flip()
<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">'__main__'</span>:

BIN
web/mario_bros.png

Before After
Width: 368  |  Height: 16  |  Size: 3.1 KiB Width: 352  |  Height: 16  |  Size: 3.1 KiB
Loading…
Cancel
Save