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
0
votes
2 answers

The problem is with the x and y position, where the mouse can be click outside of the button

The goal for this program is that the mouse must be clicked on the green rectangle shape which change the window background color to yellow or back to default color and the issue is that the color can also be change from outside of the rectangle.…
0
votes
1 answer

How to make hover effect using Gosu library

I want to make a box with a hover effect (to make a bold border of the box) when a mouse moves over it. What method should I use in Gosu library? #green rectangle that I want to give a hover effect (to become bold border) def…
Caleb Hyun
  • 69
  • 1
  • 1
  • 9
0
votes
1 answer

Same procedure doesn't work called in a Thread

I have a problem with Thread in Ruby. It's the first time I use Threads, so maybe I omit something important. I have this procedure: def define_action(field) false if field.nil? || field.empty? puts field.empty? <---- ONLY FOR…
Nifriz
  • 1,033
  • 1
  • 10
  • 21
0
votes
1 answer

getting input from libgosu in ruby

there's a method that you can check 'the key' user are pressing: Gosu.button_down? id the id parameter can be Gosu::KB_UP, Gosu::KB_1, Gosu::KB_F1... but is there any method that you can get id of the key the user are pressing?
ader
  • 5
  • 5
0
votes
1 answer

Gosu library incompatibility with windows 8.1 (ruby 2.3)

I recently installed Ruby 2.3 and the Gosu 2d game development library on Windows OS 8.1 (Surface Pro 2). The installation of both was quick and successful. Using the library I wrote a basic program (using Sublime Text 3) meant to generate a blank…
springworks00
  • 104
  • 15
0
votes
1 answer

Background Image is not showing up on Gosu

I am right now trying to create a game in Gosu and Ruby. I am running into an issue where a background image is not showing up in my code. I am getting no errors but whenever I launch the application I am getting a black screen and I stumped as to…
0
votes
1 answer

Ruby.app for use with Ruby/Gosu crashes

I downloaded the latest version of Ruby.app, a OS X app that contains a full Ruby installation (for use with Ruby/Gosu) from here But, after decompression, when I launch the app, it does not open. I am on OSX 10.11.5 El Capitan, Ruby 2.3.1. Gosu…
A. N. Other
  • 409
  • 4
  • 14
0
votes
1 answer

RubyGem Gosu 0.10.6 Install Error on Windows 10 using 'gem install gosu'

I have updated RubyGems to the newest version, I'm running Ruby 2.2.3p173, but when I go into my Powershell and type gem install gosu like RubyGems says, I get this error: ERROR: Error installing gosu: invalid gem: package is corrupt,…
GeekFitness
  • 149
  • 3
  • 12
0
votes
1 answer

Segfault after creating instance of model in console

I have the following model in my Rails application: class Window < Gosu::Window def initialize super( 250, 100, false ) @background_image = Gosu::Image.new( self, 'hello.png' ) end def draw @background_image.draw( 0, 0, 1 ) …
0
votes
1 answer

Gosu 2D Game Development Programming Example Error

I am learning Ruby at the moment so definitely a beginner and have been playing with the Gosu 2D game development and am having issues with the following code and unsure what I have missed/done incorrectly. Code is: require 'rubygems' require…
tonyf
  • 34,479
  • 49
  • 157
  • 246
0
votes
0 answers

Making a Dodger game in ruby using Gosu

I'm new to programming and Id like to make a Dodger type game using the Gosu library. I don't know if this question completely adheres to Stack Overflow's rules but I haven't seen anything to the contrary. Currently I know how to make window pop up…
ToricTorus
  • 87
  • 1
  • 2
  • 5
0
votes
1 answer

How to find a point a distance of d onwards, using angle and co-ordinates

(Using Ruby with Gosu) I have a single-point object representing a man which looks in a certain direction. I have three variables, x, y (the 2d co-ordinates of the man) and @angle (the direction he's facing, in degrees). If i want to find x and y of…
Marco Prins
  • 7,189
  • 11
  • 41
  • 76
0
votes
1 answer

Cannot print a text with Gosu in Ruby

Im sitting here with what I think is a very simple bug I just can not figure out.. Im trying to learn how to make games with Gosu gem with Ruby, but have hit a speed bump. Here is my code. require "gosu" class Hello < Gosu::Window def…
Salviati
  • 758
  • 2
  • 9
  • 28
0
votes
2 answers

Space borders in Chipmunk with Ruby

I am trying to make the edges of my window collidable, rather than having my shape drop through the floor on creation. When I was looking through the demos on the site, I saw this line of code that was ment to define the bounds of the space: [_space…
Evan Hruskar
  • 73
  • 1
  • 1
  • 7
0
votes
2 answers

rendering ruby application file (game) with rails

I have a ruby file that creates a game window for me (using the gosu gem). I am trying to render this file to a webpage. I understand that javascript is best for doing this sort of thing but as I do not know it and am not allowed to use it for this…
kittyminky
  • 478
  • 6
  • 27