Code Monkey home page Code Monkey logo

snake's Introduction

Snake atom package

Snake game for Github's Atom text editor. Just a weekend project - no real plans to make it awesome.

Installing

Use the Atom package manager, which can be found in the Settings view or run apm install snake from the command line.

Configuration

Supports the following configuration options (in your global Config file):

'snake':

  # width of the game board
  # -> defaults to 20
  'width': 40

  # height of the game board
  # -> defaults to 20
  'height': 10

  # interval in ms between snake movements
  # -> defaults to 200
  'startingInterval': 150

  # interval multiplier upon eating food
  # -> higher means slower speed increase
  # -> defaults to 0.95
  'intervalMultiplier': 0.93

  # number of food pieces on the board at any point in time.
  # -> defaults to 1
  'numFood': 2

Running it

Default keybindings are:

  • 'cmd-alt-shift-s': 'snake:toggle' - to start/stop
  • 'cmd-alt-shift-r': 'snake:reset' - to reset after game over

In action

Screenshot

Issues

Submit any issues here

To dos

  • Increase code quality/maintainability
  • Write specs

Version History

0.1.0 - first working version

License

MIT

snake's People

Contributors

maxwells avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snake's Issues

Failed to load the snake package

[Enter steps to reproduce below:]

  1. Try to install the package

Atom Version: 1.1.0
System: Microsoft Windows 10 Pro
Thrown From: snake package, v0.2.0

Stack Trace

Failed to load the snake package

At Cannot read property 'prototype' of undefined

TypeError: Cannot read property 'prototype' of undefined
  at __extends (C:\Users\Nick\.atom\packages\snake\lib\snake-view.coffee:1:1)
  at C:\Users\Nick\.atom\packages\snake\lib\snake-view.coffee:6:3
  at Object.<anonymous> (C:\Users\Nick\.atom\packages\snake\lib\snake-view.coffee:145:5)
  at Object.<anonymous> (C:\Users\Nick\.atom\packages\snake\lib\snake-view.coffee:1:1)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .coffee] (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (C:\Users\Nick\.atom\packages\snake\lib\snake.coffee:1:13)
  at Object.<anonymous> (C:\Users\Nick\.atom\packages\snake\lib\snake.coffee:1:1)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .coffee] (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Package.module.exports.Package.requireMainModule (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\package.js:725:34)
  at C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\package.js:176:28
  at Package.module.exports.Package.measure (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\package.js:153:15)
  at Package.module.exports.Package.load (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\package.js:167:12)
  at PackageManager.module.exports.PackageManager.loadPackage (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\package-manager.js:396:14)
  at PackageManager.module.exports.PackageManager.activatePackage (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\package-manager.js:473:30)
  at C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:444:29
  at exit (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:73:16)
  at triggerExitCallback (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\buffered-process.js:213:47)
  at C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\buffered-process.js:220:18
  at Socket.<anonymous> (C:\Users\Nick\AppData\Local\atom\app-1.1.0\resources\app.asar\src\buffered-process.js:98:18)
  at emitOne (events.js:82:20)
  at Socket.emit (events.js:169:7)
  at Pipe._onclose (net.js:467:12)

Commands

     -5:30.1.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -3:54.4.0 core:select-all (atom-text-editor.editor.is-focused)
     -3:53.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -3:53.5.0 application:open-file (atom-text-editor.editor.is-focused)
     -2:51.3.0 core:backspace (atom-text-editor.editor.mini.is-focused)
  8x -2:51.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "steam-pirate-syntax"
    ]
  }
}

Installed Packages

# User
css-snippets, v0.9.0
linter-gcc, v0.3.9
snake, v0.2.0
steam-pirate-syntax, v0.3.0

# Dev
No dev packages

Uncaught TypeError: Cannot read property 'prototype' of undefined

Got this error on launch
Would be happy to retry

Atom Version: 1.0.0
System: Mac OS X 10.9.5
Thrown From: snake package, v0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'prototype' of undefined

At /Users/ramseybarghouti/.atom/packages/snake/lib/snake-view.coffee:5

TypeError: Cannot read property 'prototype' of undefined
  at __extends (/Users/ramseybarghouti/.atom/packages/snake/lib/snake-view.coffee:5:199)
  at /Users/ramseybarghouti/.atom/packages/snake/lib/snake-view.coffee:6:3
  at Object.<anonymous> (/Users/ramseybarghouti/.atom/packages/snake/lib/snake-view.coffee:145:5)
  at Object.<anonymous> (/Users/ramseybarghouti/.atom/packages/snake/lib/snake-view.coffee:1:1)
  at Module._compile (module.js:452:26)
  at Object.requireCoffeeScript (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/coffee-cash/lib/coffee-cash.js:85:19)
  at Module.load (module.js:347:32)
  at Function.Module._load (module.js:302:12)
  at Module.require (module.js:357:17)
  at require (module.js:376:17)
  at Object.<anonymous> (/Users/ramseybarghouti/.atom/packages/snake/lib/snake.coffee:1:13)
  at Object.<anonymous> (/Users/ramseybarghouti/.atom/packages/snake/lib/snake.coffee:1:1)
  at Module._compile (module.js:452:26)
  at Object.requireCoffeeScript (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/coffee-cash/lib/coffee-cash.js:85:19)
  at Module.load (module.js:347:32)
  at Function.Module._load (module.js:302:12)
  at Module.require (module.js:357:17)
  at require (module.js:376:17)
  at Package.module.exports.Package.requireMainModule (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:709:34)
  at Package.module.exports.Package.activateConfig (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:257:12)
  at PackageDetailView.module.exports.PackageDetailView.activate (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-detail-view.js:163:26)
  at PackageDetailView.module.exports.PackageDetailView.initialize (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-detail-view.js:146:12)
  at PackageDetailView.View (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/node_modules/space-pen/lib/space-pen.js:184:25)
  at new PackageDetailView (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-detail-view.js:38:54)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/settings-view.js:256:22
  at SettingsView.module.exports.SettingsView.getOrCreatePanel (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/settings-view.js:261:19)
  at SettingsView.module.exports.SettingsView.showPanel (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/settings-view.js:306:24)
  at space-pen-div.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-card.js:260:26)
  at space-pen-div.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
  at space-pen-div.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -1:42.5.0 editor:select-to-first-character-of-line (atom-text-editor.editor.mini.is-focused)
     -1:40.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{}

Installed Packages

# User
autocomplete-plus-python-jedi, v0.3.6
autocomplete-python, v0.5.1
linter-python-pep8, v0.2.0
linter-python-pyflakes, v0.1.0

# Dev
No dev packages

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:53:11)
SnakeView.toggleOnEditor (/Users/sduy/.atom/packages/snake/lib/snake-view.coffee:52:9)

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.