Skip to content

Commit

Permalink
Added readl to gameover screen so it doesn't instantly close
Browse files Browse the repository at this point in the history
  • Loading branch information
QFSW committed Jul 11, 2019
1 parent 10d7760 commit 796634a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/game/game_main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ PUBLIC game_main
EXTERN checkgrid:PROC
EXTERN printgrid:PROC, initgrid:PROC, mergegrid:PROC, rotategridn:PROC
EXTERN addnum:PROC
EXTERN print:PROC, pinput:PROC
EXTERN print:PROC, readl:PROC
EXTERN pinput:PROC
EXTERN rseedt:PROC

ASCII_LINE EQU 10
Expand All @@ -14,7 +15,7 @@ GRID_SIZE EQU GRID_WIDTH * GRID_WIDTH
db "Use wasd to move the tiles along the grid, if two tiles of the same number touch, they'll merge", ASCII_LINE
db "Try to get a 2048 tile, or go as high as you can!", ASCII_LINE
db "The game will end if every tile gets filled and you can't merge any tiles", 0
gameoverstr db "Game over!", 0
gameoverstr db "Game over!", ASCII_LINE, 0
grid dq GRID_SIZE DUP(0)
grbuf dq GRID_SIZE DUP(?)

Expand Down Expand Up @@ -83,6 +84,10 @@ gameover:
LEA RCX, gameoverstr
CALL print

LEA RCX, grbuf
MOV RDX, 1
CALL readl

LEAVE
POP R12
MOV RAX, 0
Expand Down

0 comments on commit 796634a

Please sign in to comment.