File tree Expand file tree Collapse file tree
autoload/VimGameCodeBreak Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22# VimGameCodeBreak
33
4- version 0.1
5-
64![ animated demonstration] ( https://user-images.githubusercontent.com/1855714/27774457-7e001646-5fcd-11e7-9e90-c37eafefad9c.gif )
75
86## How to play
97
1081 . open your code or text file in Vim
1191 . ` :VimGameCodeBreak ` to Start
1210
13- h | l | space | ` | ] | [ | q
14- --- | --- | --- | --- | --- | --- | ---
15- ← | → | new ball | cheat key | GOD mode | human mode | quit
11+ h | l | space | ` | ] | [ | q | Q
12+ --- | --- | --- | --- | --- | --- | --- | ---
13+ ← | → | new ball | cheat key | GOD mode | human mode | end game | quit & close game
1614
1715## Installation
1816
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ function! VimGameCodeBreak#game#main()
6363
6464 endwhile
6565
66+ if s: loop == -1
67+ bdelete
68+ endif
69+
6670endfunction
6771
6872function ! VimGameCodeBreak#game#createNewItem (x , y , dir )
@@ -112,6 +116,11 @@ function! s:initKeys()
112116 let key [' [' ] = funcref (' <SID>disableGodMode' )
113117
114118 function key .q ()
119+ call s: end ()
120+ call VimGameCodeBreak#compatiblity#quit ()
121+ endfunction
122+
123+ function key .Q ()
115124 call s: quit ()
116125 call VimGameCodeBreak#compatiblity#quit ()
117126 endfunction
@@ -196,6 +205,10 @@ function! s:quit()
196205 let s: loop = -1
197206endfunction
198207
208+ function ! s: end ()
209+ let s: loop = 0
210+ endfunction
211+
199212function ! s: enableGodMode ()
200213 let s: godMode = 1
201214 for l: item in s: item
You can’t perform that action at this time.
0 commit comments