Giter Site home page Giter Site logo

gosu-examples's Introduction

Gosu Examples

This is a collection of Ruby example games for the Gosu library.

(You can find C++ examples in the main gosu repository.)

To install and run the gosu-examples gem:

gem install gosu-examples
gosu-examples

You can also download and unpack this repository and then run individual examples from the terminal:

cd gosu-examples-master/examples
ruby tutorial.rb

Some examples require the following additional libraries:

gem install chipmunk
gem install rmagick
gem install opengl-bindings

gosu-examples's People

Contributors

cyberarm avatar jlnr avatar kentdahl avatar kjarrigan 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

Watchers

 avatar  avatar  avatar  avatar

gosu-examples's Issues

When running gosu-examples in bin/* - outputs errors (added logs)

This issue contains attempts and error outputs in relation to ruby version:

ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]

C:\git_projects\gosu-examples\bin>ruby gosu-examples
*** Cannot load chipmunk_and_rmagick.rb:
cannot load such file -- chipmunk

*** Cannot load chipmunk_integration.rb:
cannot load such file -- chipmunk

*** Cannot load opengl_integration.rb:
cannot load such file -- gl

*** Cannot load rmagick_integration.rb:
cannot load such file -- rmagick

Added Gemfile with contents to tackle issues

source 'https://rubygems.org'
gem 'opengl'
gem 'chipmunk'
gem 'rmagick'

**Chipmunk installs as intended

ERROR:  Error installing opengl:
        The last version of opengl (= 0.10.0) to support your Ruby & RubyGems was 0.10.0. Try installing it with `gem install opengl -v 0.10.0`
        opengl requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.

As above states, ruby 2.5.0+ will not work as inteded i reckon?

C:\git_projects\gosu-examples>gem install rmagick
Fetching: rmagick-2.16.0.gem (100%)
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0/ext/RMagick
C:/Ruby25_64/bin/ruby.exe -r ./siteconf20180826-12800-m7rxdg.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby25_64/bin/$(RUBY_BASE_NAME)
extconf.rb:141:in ``': No such file or directory - identify -version (Errno::ENOENT)
        from extconf.rb:141:in `configure_compile_options'
        from extconf.rb:16:in `initialize'
        from extconf.rb:548:in `new'
        from extconf.rb:548:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0 for inspection.
Results logged to C:/Ruby25_64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/rmagick-2.16.0/gem_make.out

Lacking imagemagick i reckon

--

in addition for windows based i discovered the gem:

https://rubygems.org/gems/rmagick-windows

This contains fixes it claims, does this require investigation in regards to bugs that might affect stuff in relation to images and others?

Dumping install log here aswell

C:\git_projects\gosu-examples>gem install rmagick-windows
Fetching: rmagick-windows-2.16.5.gem (100%)
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rmagick-windows:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-windows-2.16.5/ext/RMagick
C:/Ruby25_64/bin/ruby.exe -r ./siteconf20180826-10484-1wu36fr.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby25_64/bin/$(RUBY_BASE_NAME)
extconf.rb:141:in ``': No such file or directory - magick identify -version (Errno::ENOENT)
        from extconf.rb:141:in `configure_compile_options'
        from extconf.rb:16:in `initialize'
        from extconf.rb:542:in `new'
        from extconf.rb:542:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-windows-2.16.5 for inspection.
Results logged to C:/Ruby25_64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/rmagick-windows-2.16.5/gem_make.out

Update gem

I noticed that while using the gem version of this repository there's a font deprecation warning (#15), and bold text doesn't appear as such in the welcome.rb example. This however was fixed in commits ba3cf92 and ea550c7, but the latest version of this project (and the one on RubyGems) is v1.0.5. It would be nice to bump the version so the people that install from gem can get these changes. Thanks ๐Ÿ˜„

Windows Install: fork() function is unimplemented on this machine (NotImplementedError)

I currently use Ruby 3.3.0 with the devkit, downloaded through RubyInstaller. I installed gosu using gem install gosu and gosu-examples using gem install gosu-examples - so the usual installation process.

I load up gosu-examples and everything seems normal, but attempting to see any program's source code or open the examples folder immediately crashes the demo program while returning this error in the command prompt/terminal.

C:/Users/user/.local/share/gem/ruby/3.3.0/gems/gosu-examples-1.0.7/bin/gosu-examples:90:in `fork': fork() function is unimplemented on this machine (NotImplementedError)
        from C:/Users/user/.local/share/gem/ruby/3.3.0/gems/gosu-examples-1.0.7/bin/gosu-examples:90:in `open_file_or_folder'
        from C:/Users/user/.local/share/gem/ruby/3.3.0/gems/gosu-examples-1.0.7/bin/gosu-examples:52:in `button_down'
        from C:/Users/user/.local/share/gem/ruby/3.3.0/gems/gosu-1.4.6/lib/gosu/patches.rb:64:in `tick'
        from C:/Users/user/.local/share/gem/ruby/3.3.0/gems/gosu-examples-1.0.7/bin/gosu-examples:95:in `<top (required)>'
        from C:/Users/user/AppData/Local/Microsoft/WindowsApps/gosu-examples:32:in `load'
        from C:/Users/user/AppData/Local/Microsoft/WindowsApps/gosu-examples:32:in `<main>'

From my search, it seems that fork() is a POSIX (Linux) function... which doesn't make sense, because this is a Windows machine I installed it on and I have everything else set up properly.

It's also worth noting that I tried the same steps with Ruby 3.2.3, and the same issues occurred. And yes, I already uninstalled Ruby 3.2.3 before reinstalling Ruby 3.3.0.

Deprecation warning

DEPRECATION WARNING: draw is deprecated; use Font#draw_text or Font#draw_markup instead.
draw called from /Depot/j/gosu-examples-1.0.5/lib/gosu-examples/sidebar.rb:26:in `draw'.

I think simply using draw_text rather than draw should suffice fine; I have been working
through old gosu examples and the old ones have lots of deprecation warnings by the
way. Unsurprising. :)

Perhaps gosu-examples could be changed into "gosu-addons" or something and
integrate not only examples but modifications to gosu itself, including some physics stuff
and such like collision calculations and what not. Like to make it easier in general to
create games without having to think too much.

LICENSE needs clarification re: content

Not all content is under my copyright, some media files have been contributed and some have been downloaded from public domain sites.

It would probably be good to hunt them down to add a link + mini-license, or to replace them by new placeholders if we can't find the original files.

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.