A minimal Gosu example

Installing Gosu on Debian (Jessie)

Type sudo apt-get install libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev

Then type sudo gem install gosu

Running the example

Type irb and copy and paste the following code into it:

require 'gosu'

class GameWindow < Gosu::Window
  def initialize
    super 640, 480
    self.caption = "Gosu Tutorial Game"
  end

  def update
  end

  def draw
  end
end

window = GameWindow.new
window.show


Screenshot

Screenshot of the Gosu application

Resources

  • Getting Started on Linux · gosu/gosu Wiki [github.com]
  • gosu/gosu: 2D game development library for the desktop (Ruby and C++) and iOS (C++ only). MIT licensed. [github.com]
  • Gosu (library) [wikipedia.org]