Code Monkey home page Code Monkey logo

vim-game-code-break's Introduction

VimGameCodeBreak

animated demonstration

How to play

  1. open your code or text file in Vim
  2. :VimGameCodeBreak to Start
h l space ` ] [ q Q
โ† โ†’ new ball cheat key GOD mode human mode end game quit & close game

Setting

If you want to play with more than three balls, you can modify the following:

" .vimrc
let g:vim_game_code_break_item_limit = 4    " default value is 2

WARNING: Too many balls can slow down the game or cause bugs. I recommend the default value : 2 If the game speed is too slow, try :syntax off before starting the game.

Installation

VimPlug

Place this in your .vimrc:

Plug 'johngrib/vim-game-code-break'

Then run the following in Vim:

:source %

:PlugInstall

vim-game-code-break's People

Contributors

johngrib avatar tyru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-game-code-break's Issues

VimGameCodeBreak opens in vertical split

When i start the game it vertically splits my screen, where the game starts in the left pane and the original remains in the right pane. Any idea how to prevent it from doing this?

Doens't seem to install in SpaceVim

Hi,

on regular vim modded with SpaceVim, doesn't seem to do anything.

I installed the plugin with dein#add('johngrib/vim-game-code-break'), but at the next reboot I don't see the custom command added.

Adding the plugin to init.vim like

let g:spacevim_custom_plugins = [['johngrib/vim-game-code-break']]

and running :SPInstall doesn't do much..

Any clue?
Thanks

E716: Key not present in Dictionary: hitLimitEvent()

I'm seeing the following error after a while (in

):

Error detected while processing function VimGameCodeBreak#game#main[25]..<SNR>204_updateItems[11]..<SNR>204_moveBall[9]..<SNR>213_update[1]..<SNR>213_pongX:
line   18:                                                                                                                                                  
E716: Key not present in Dictionary: hitLimitEvent()
E15: Invalid expression: self.hitLimitEvent()       

echom string(self) gives this:

{'time_check': 0, 'active': 1, 'disableGod': function('~@<80>~@^CQ219_disableGod'), 'hitWallEvent': function('~@<80>~@^CQ219_hitWallEvent'), 'create': function('~@<80>~@^CQ219_create'), 'i
temRate': 50, 'icon': 'O', 'futureX': function('~@<80>~@^CQ213_futureX'), 'hitTopEvent': function('~@<80>~@^CQ219_hitTopEvent'), 'hitCharXEvent': function('~@<80>~@^CQ219_hitCharXEvent'), 'futureY': function('~@
<80>~@^CQ213_futureY'), 'isInitialized': function('~@<80>~@^CQ213_isInitialized'), 'hitShipEvent': function('~@<80>~@^CQ219_hitShipEvent'), 'direction': {'x': -1, 'y': -1}, 'hitFloorEvent': function('~@<80>~@^CQ219_hitFloorEvent'), 'tick': function('~@<80>~@^CQ213_tick'), 'enableGod': function('~@<80>~@^CQ219_enableGod'), 'hide': function('~@<80>~@^CQ213_hide'), 'move': {'left-down': {'x': -1, 'y': 1}, 'right': {'x': 1, 'y': -1}, 'right-down': {'x': 1, 'y': 1}, 'left': {'x': -1, 'y': -1}}, 'reverseY': function('~@<80>~@^CQ213_reverseY'), 'kill': function('~@<80>~@^CQ213_kill'), 'isReady': function('~@<80>~@^CQ213_isReady'), 'doNothing': function('~@<80>~@^CQ213_doNothing'), 'interval': 50, 'hitBottomWallEvent': function('~@<80>~@^CQ219_hitBottomWallEvent'), 'reverseX': function('~@<80>~@^CQ213_reverseX'), 'show': function('~@<80>~@^CQ213_show'), 'old_x': 69, 'old_y': 82, 'tock': function('~@<80>~@^CQ213_tock'), 'roll': function('~@<80>~@^CQ213_roll'), 'x': 68, 'y': 81, 'update': function('~@<80>~@^CQ213_update'), 'pongX': function('~@<80>~@^CQ213_pongX'), 'pongY': function('~@<80>~@^CQ213_pongY'), 'hitCharYEvent': function('~@<80>~@^CQ219_hitCharYEvent'), 'common': {'removeWord': function('~@<80>~@^CQ205_removeWord'), 'sleep': function('~@<80>~@^
CQ205_sleep'), 'getCharValue': function('~@<80>~@^CQ205_getCharValue'), 'drawChar': function('~@<80>~@^CQ205_drawChar'), 'rand': function('~@<80>~@^CQ205_rand'), 'prepareLine': function('~@<80>~@^CQ205_prepareLine')}}

how to play with multiple balls at the same time?

thanks for your game first,it is really an interesting idea that play in vim.
I noticed that we could play with two balls at the same time .
it maybe more interesting if we could play with as many as balls we want at the same time .

Statusbar automatically sets to 2

I set the statusbar to 0 to don't see the statusbar but after running :VimGameCodeBreak command it makes statusline set to 2, Is there a solution?

Errors when opening with Vi IMproved 7.4

Hi johngrib,

I am getting the following errors when opening vim-game-code-break with Vi IMproved 7.4:

No matching autocommands
Error detected while processing function VimGameCodeBreak#game#main[2]..VimGameCodeBreak#common#new:
line 4:
E117: Unknown function: funcref
E15: Invalid expression: funcref('rand')
line 5:
E117: Unknown function: funcref
E15: Invalid expression: funcref('drawChar')
line 6:
E117: Unknown function: funcref
E15: Invalid expression: funcref('getCharValue')
line 7:
E117: Unknown function: funcref
E15: Invalid expression: funcref('removeWord')
line 8:
E117: Unknown function: funcref
E15: Invalid expression: funcref('sleep')
line 9:
E117: Unknown function: funcref
E15: Invalid expression: funcref('prepareLine')
No matching autocommands

I'd appreciate if you could you provide a solution to this issue.

:VimGameCodeBreak opens new vertical split window

Hi!
By running :VimGameCodeBreak second split window opening instead the same bufer

I tried clean vim environment by commenting in .vimrc all except

call plug#begin()
Plug 'johngrib/vim-game-code-break'
call plug#end()

My installed version is:

pacman -Q | grep vim
gvim 8.0.1476-1
vim-runtime 8.0.1476-1
vim-spell-ru 20150901-1

The behavior is same in vim and gvim
screen_2018-02-22_17-53-41_window
screen_2018-02-22_18-09-02_window

Errors when opening with neovim

Hi johngrib,

You had a really neat idea, and you built it. Congrats!

Sadly, I'm getting a lot of errors when I open it with neovim 0.17

I'm getting the following errors:

Error detected while processing function VimGameCodeBreak#game#main[2]..VimGameCodeBreak#common#new:                                   
line    4:                                                                                                                             
E117: Unknown function: funcref                                                                                                        
E15: Invalid expression: funcref('<SID>rand')                                                                                    

And a lot more of Invalid expression: funcref('...'); one for everytime funcref() is used, I assume. At this time it was not playable. I then replaced funcref() with function() (see here) and now the game starts.
I still get these errors on startup:

Error detected while processing function VimGameCodeBreak#game#main[3]..<SNR>128_init[5]..VimGameCodeBreak#init#createBuffer[20]..<SNR>
131_setLocalSetting:                                                                                                                   
line   16:                                                                                                                             
E518: Unknown option: signcolumn=no                                                                                                    
Error detected while processing function VimGameCodeBreak#game#main[15]..<SNR>128_initKeys:                                            
line    5:                                                                                                                             
E118: Too many arguments for function: function                                                                                        
E15: Invalid expression: function(s:life.set, [99999])

And these when trying to get a new ball

Error detected while processing function VimGameCodeBreak#game#main[25]..<SNR>128_updateItems:                                         
line    3:                                                                                                                             
E121: Undefined variable: ids                                                                                                          
E116: Invalid arguments for function filter                                                                                            
E121: Undefined variable: ids                                                                                                          
E116: Invalid arguments for function filter                                                                                            
E121: Undefined variable: ids                                                                                                          
E116: Invalid arguments for function filter                                                                                            
E121: Undefined variable: ids                                                                                                          
E116: Invalid arguments for function filter                                                                                            
[...]                    

Could you look into this? I'm looking forward to goofing off ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.