A snake game built using Ruby
changyuyan / snake Goto Github PK
View Code? Open in Web Editor NEWA snake game built using Ruby
A snake game built using Ruby
During the intro of the game, after a few seconds, the game automatically crashes itself. And here's the error message:
/Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/text.rb:20:in `exist?': no implicit conversion of nil into String (TypeError)
from /Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/text.rb:20:in `initialize'
from snake.rb:101:in `new'
from snake.rb:101:in `draw_intro'
from snake.rb:202:in `block in <main>'
from /Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/window.rb:368:in `update_callback'
from /Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/window.rb:392:in `ext_show'
from /Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/window.rb:392:in `show'
from /Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/window.rb:153:in `show'
from /Users/changyuyan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby2d-0.9.4/lib/ruby2d/dsl.rb:32:in `show'
from snake.rb:251:in `<main>'
It definitely has something to do with the new Text
objects, but I haven't figured out what exactly causes the error. The syntax seems to have no problem.
For example,
etc.
need to be able to adjust difficulty of the game, calculated by speed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.