Questions tagged [libgosu]

Gosu is a 2D game development library for the Ruby and C++ programming languages.

See homepage at http://www.libgosu.org/

See Ruby documentation at https://www.rubydoc.info/github/gosu/gosu/

118 questions
1
vote
1 answer

Ruby can't find class when I use require_relative

as part of an assignment im trying to use the gosu gem to make a simple snake game. i was instructed to follow this guide: https://github.com/gosu/gosu/wiki/ruby-tutorial i had gotten quite far and could initialize a snake game but had put it in the…
пaean
  • 61
  • 8
1
vote
1 answer

How to pause music tracks without skipping them

I am working on a GUI music player, and my program needs to play all the tracks in order. I also need to pause the tracks when I press the right arrow key: def button_down(id) case id when Gosu::MsLeft @locs = [mouse_x, mouse_y] if…
Ahsan1999
  • 37
  • 6
1
vote
2 answers

Ruby Gosu not able to find the background image

def initialize super 200, 135, false self.caption = "Gosu Cycle Example" @shape_x = 0 # Create and load an image to display @background_image = Gosu::Image.new("media/earth.png") #this is causing the error # Create and load a font for…
Ahsan1999
  • 37
  • 6
1
vote
1 answer

Is there a way to play a list of music in order using Gosu?

I'm using Gosu (with Ruby version 2.5.5) to make a music player with a GUI, I have a basic player to play one song at a time, but I'm required to tweak the player so I can play one song after the other from this: @song =…
1
vote
1 answer

Error in my program!!!! There is no rendering queue for this operation

I'm creating a game with ruby and gosu, and I get an error: C:/Ruby26-x64/destroy!/bullet.rb:14:in draw_rot': There is no rendering queue for this operation (RuntimeError) from C:/Ruby26-x64/destroy!/bullet.rb:14:indraw' from…
1
vote
0 answers

Ruby/Gosu: Issue with calling instance attributes inside loops

As a foreword, I want to say that I am very new to programming and this program is definitely not written in the smartest way. Also, I'm using the terminal to show debugging but the program is graphical, as shown near the end. In a Gosu program I…
1
vote
0 answers

Instantiating class throws uninitialized constant error

so ive made 2 classes the grass inherits from the Tile class, anytime the Tile class is called it should go to the grass class and create a tile containing itself. the problem is i get "uninitialized constant Tile::Grass (name error)" and im not…
Jay
  • 83
  • 1
  • 10
1
vote
1 answer

How can i change the character image non Ruby Gosu

im building a basic game in the style of the original pokemon games using the ruby gosu library. Ive managed to figure out how to move the originally loaded sprite about but i cant figure out how to clear that sprite and draw the new sprite e.g.…
user1538594
1
vote
1 answer

Ruby I/O Existence Issues

I have a decent amount of knowledge about Ruby code, but I do have an issue with my current project. I use Gosu to make 2D games (and once I figure out how, simple 3D games), so I need a resolution. And this is where my question comes in, why does…
1
vote
1 answer

Ruby/Gosu getting a bouncing image

I'm following the book "Learn game programming with ruby" one of the exercises is loading an image with gosu and making it bounce off the edges of the screen. I followed the exercise and the image bounces fine off the top and left corners but will…
1
vote
2 answers

How to draw subimage with Ruby Gosu library?

I'm trying to draw on the screen the subimage of an Image instance using this subimage method. It seems to be pretty straight forward to do it but when I call the function it returns a NilClass instead of a new Image. The main image is defined…
Fnr
  • 2,096
  • 7
  • 41
  • 76
1
vote
1 answer

Gosu::Song in Ruby only playing first note

I'm trying to write a simple game in Ruby (ver 2.2.6) on Windows. I installed the Gosu gem to handle the audio, and I have a soundtrack file that I would like to play: @soundtrack = Gosu::Song.new("theme.ogg") I cannot use Sample, because I need to…
L.N.M
  • 45
  • 8
1
vote
1 answer

How can I jump on Gosu gem from Ruby?

I'm trying to recreate a simple game but I'm stuck at the moment that I'm trying to make jump my character( or player). I've been checking the example from gosu but it's not really clear for me. Can someone help me? Here is my window code: class…
Ruffeng
  • 537
  • 7
  • 23
1
vote
1 answer

How to enable high-DPI mode in Gosu

How can I enable High-DPI mode in Gosu? Also, how would I get the DPI to multiply coordinates by?
Zac
  • 813
  • 10
  • 22
1
vote
2 answers

Why won't my Ruby script execute in TextMate?

I'm learning basic game programming using Ruby and Gosu. I've installed Gosu from RubyGems, and it is currently sitting in /usr/local/lib/ruby/gems/1.9.1/gems/. The full path is /usr/local/lib/ruby/gems/1.9.1/gems/gosu-0.7.24-universal-darwin/. When…
mybuddymichael
  • 1,660
  • 16
  • 20