Not logged inGosu Forums
Forum back to Help Search Register Login
Up Forum
Topic Installing chipmunk in Ruby 2.4.3 failed! By rremedio Date 2018-04-17 17:33
I've been avoiding Ruby 2.4 and up since apparently it breaks some gems (maybe because of the new devkit thing?)
Topic Survey about Gems and Rubyversion By rremedio Date 2018-03-19 17:40
- Windows 10, the horror (really miss W7)
- Ruby
- 2.3.6 because some gems unrelated to Gosu which I use for work were not compatible with later versions last time I tried
- mostly chipmunk for some old action projects and datamapper for projects that need database. I mostly do small concept gameplay "demos" (can't even call them real demos) and abandon them. Those can mostly be done in pure Gosu, so I never got deep into other gems. Someday I will create a game and I will look into gl, ashton, probably some socket related gem, etc
Topic Correct way of using draw_as_quad By rremedio Date 2017-10-04 12:42
Thanks! Hopefully it can be implemented.

I was almost going to create a separated polygon for each line, which would probably be bad.
Topic Useful tools for game development By rremedio Date 2017-10-03 14:52
Deflemask is an awesome chiptunes tracker, emulating a bunch of old sound chips accurately, such as the YM2612 (Sega Mega Drive). It runs on Windows, Mac OS X and Linux.

Its page says:
So you can make music for:
SEGA Genesis/Mega Drive
SEGA Master System
Nintendo Game Boy
NEC PC-Engine/TurboGrafx-16
Nintendo NES
Commodore 64
Arcade System (SEGA X/Y boards)

But you can also use them in your Gosu games =)
Topic Correct way of using draw_as_quad By rremedio Date 2017-10-03 14:17
So, after reading through I thought it would be nice to create a pseudo 3d racer in Ruby/Gosu. I'm especially interested in the "True 3d-Projected Segments" section since Road Rash is one of my all-time favorites and it looks great.

I managed to create an early version of the engine and it runs very fast (60fps with up to 900 polygon calculations made in pure Ruby per frame in my use case...increasing the drawing distance so we have 1500 polygons didn't impact fps, but that's not even needed).

Here is how it looks:


The problem is #Image.draw_as_quad is not behaving as I would like. It displays the correct shape but the image is distorted in the wrong way. In case it is not so noticeable in the previous picture, here is another one with a straight line in the road texture. Shouldn't it follow the road? It "zig-zags" in the middle. I've played with the vertex order but it didn't help. Is there anything I'm missing (maybe that's the intented behavior?)? In case you wonder, the strips at the center of the road look better because I'm using 2 side by side textures for the road, as a way to minimize this "bug". Apparently, this won't happen if I use a perfectly rectangular shape (it can be done that way with the "pure raster" approach on the pseudo 3d tutorial, but it would limit the engine a lot).

Topic Ocra and Chipmunk By rremedio Date 2016-09-13 19:41
Thanks! It worked like a charm.
Topic Ocra and Chipmunk By rremedio Date 2016-09-13 19:41
I'd like to help, but I don't have too much time myself. Maybe I can look into it (and learn how to do it) later this year.

Thanks for your work in both chipmunk gems!
Topic Ocra and Chipmunk By rremedio Date 2016-09-13 16:54
I'm almost sure this issue didn't happen with older versions of the Chipmunk gen. The process of creating an exe with Ocra is successful, but when I try to run it I get the following message:

Ignoring chipmunk- because its extensions are not built.  Try: gem pristine chipmunk --version

gem pristine chipmunk --version doesn't fix it.

Does anybody know how to make it work?

I made it work with chipmunk-ffi but there were some new problems:

1 - I get a bunch of undesired double/triple hits being handled despite my game checking and handling them (I don't have this problem with the chipmunk gem, but it is no big deal since I can probably fix it in my collision callbacks).
2 - I get runtime errors now and then (can't understand the reason since it appears to be random, with the game behaving differently each time I run it, without code changes. Probably need another .dll for chipmunk?).

It also required me to add some simple functionalities to the Shape classes, which makes me think chipmunk-ffi may be outdated compared to chipmunk gem.

Any ideas?

ps.: I'm using the dreaded Windows 10 Home 64bits with Ruby 2.0.0p576 and Gosu 0.10.8
Topic Trying a simple Atlantis remake By rremedio Date 2016-09-13 16:34
Thanks! tileable: also helps a lot!
Topic Trying a simple Atlantis remake By rremedio Date 2016-09-08 19:22
Thank you!

Good catch on the Gemfile, no reason not to add it! Should be done soon.

About tabs. I understand that many people prefer spaces but I can't help myself. It is a very old habit and I actually suffer trying to code without tabs.

The original game ends with the flickering screens, but it has an animation of a spaceship taking off. I will probably add it (and a proper "game over" screen) later, but I'm still thinking about adding the second stage before that.

Good luck with your projects!
Topic Trying a simple Atlantis remake By rremedio Date 2016-09-07 14:41
Hi there!

Github link
Windows Executables

A bit frustrated for never finishing my games I decided to try something simpler. I have a soft spot for the Atari 2600 and back in the day some of my favorite games were Atlantis and Cosmic Ark so I decided to remake Atlantis just for the sake of doing it. It is a bit trickier than I expected and using Chipmunk was probably overkill but it is almost completed. I just need to add the sound effects and it will be completed as far as remaking the original game goes. I did change a few things to get it closer to my tastes (mainly enemy spacing, spawning system, and point system.

I'm also thinking about adding a second stage. The original game had no way to win (like most Atari 2600 games), but when you died it would show the Cosmic Ark launching and this would link it to the next game in the series: Cosmic Ark. This was neat for that time if you count the hardware limitations (and sequels not being a thing at all back then), but I think having the Ark going to space and fighting some aliens before it starts its journey would be nice.

Once it is finished I will post it at Github. There isn't very much going on in the code but at least it shows some Chipmunk uses that were not covered in the Chipmunk integration tutorial. It is a fun project and maybe I will do it again for other Atari games (my initial idea was to remake Phoenix, another one of my favorites, and Cosmic Arc could use a remake with some changes). For now, I would like to know if you guys have any idea about what the second stage should look like. My initial thought is something in the vein of Space Invaders/Demon Attack to keep the Atari 2600 feeling. What do you think?

EDIT: since I won't be able to work in this game for the next few weeks I decided to commit it to Github. You can check it at HERE. I'm aware of the chaos in the code with some variables being passed here and the for no reason, no logical organization at all of the many parts of the code, and methods (and maybe classes) I don't even call at all. I know I shouldn't, but I always go for getting it working and only worry about getting it working correctly later.
Attachment: screen.JPG - Atlantis (26k)
Topic OpenGL vs fake 3D By rremedio Date 2015-11-21 17:16

Well, this code is a mess. I wouldn't use any of this in any project. It is just to test the validity of the equation.

require 'gosu'


class GameWindow < Gosu::Window
  def initialize
  super(600, 400, true)
    $window=self, "tile1.png", true) #gray tile 40x40, "tile3.png", true) #yellow tile 80X80
    for i in 0..18
      #[tile img, x position]
      @wall<<[@img1,i*40] #wall tiles
      @f1<<[@img3,i*40] #floor tiles
    @cx=350 #sort of camera_x
    @cy=180.1 #horizon_y
    for i in 0..2
      @box<<*200, @cx, @cy)
  def update
    self.caption = "Editor: #{Gosu::fps} fps"
      @wall.each do |pie|
      @f1.each do |pie|
      @box.each do |box|
    @box.each do |box|
  #this could be much simpler, probably
  #I just made a drawing and used basic math
  #x1,y1 are coordinates of a point (1) in the screen
  #y2 is the y coordinate on the screen of another point (2)
  #points 1 and 2 are conected by a line, perpendicular to the wall
  def getp(x1,y1,y2)
  def draw
    @wall.each do |brick|
      if brick[1].between?(-40,740) #if we want to draw it
        #fill the screen vertically
        brick[0].draw(brick[1], 0, 0, 1, 1, White, :default)
        brick[0].draw(brick[1], 40, 0, 1, 1, White, :default)
        brick[0].draw(brick[1], 80, 0, 1, 1, White, :default)
        brick[0].draw(brick[1], 120, 0, 1, 1, White, :default)
        brick[0].draw(brick[1], 160, 0, 1, 1, White, :default)
        brick[0].draw(brick[1], 200, 0, 1, 1, White, :default)
      #when scrolling, we move the tile to right end if it moves left off the screen
        if brick[1]<-40
    #we should have a class for the floor tiles and we should calculate the coordinates in the update step, but I was just checking if the calculations are correct
    @f1.each do |b|
      if b[1].between?(-40,740)
        #drawing the floor tiles
        #the floor "top"
        #the "front" face of the floor "blocks"
        #when scrolling, we move the tile to right end if it moves left off the screen
        if b[1]<-40
    @box.each do |box|
  def button_down(id)
    if id == Gosu::KbEscape
      puts @cy
    #move the horizon line up/down
    if id==Gosu::KbUp
      @box.each do |box|
    if id==Gosu::KbDown
      if @cy<235
        @box.each do |box|

class Box
  def initialize (x, cx, cy)
    @x=x$window, "tile2.png", true) #red tile 40x40
  def getp(x1,y1,y2)
  def move(x)
  def move_horizon(y)
  def update
    #when scrolling, we move the block to right end if it moves left off the screen
    if @x<-40
  def draw
    if @x.between?(-42,702)
      #drawing the faces of the boxes
      #we assume the block top being below the horizon
      #we can easily make this more generic by adding the calcs for it being above the horizon
      #again, we should add variables for the box shape and make calculations in the update step
      #front face
      #top face
      #left face, only displayed if the block left face is to the right of @cx
      if @x>@cx
      #right face, only displayed if the block right face is to the left of @cx
      if (@x+40)<@cx

window =
Topic OpenGL vs fake 3D By rremedio Date 2015-11-21 14:03
Hummm...maybe I'm overcomplicating things by using 3 images for each box. I'm gonna try this trick.
Topic OpenGL vs fake 3D By rremedio Date 2015-11-21 13:58
I think I should explain myself better

Here is more or less what I want to do (the slowdown is because of the recording software). In the game that I have in mind, there would be no auto-scrolling.

The math is not tricky. It is just one equation that takes the y position of the horizon on the screen and returns the x position of a point. Since the camera will never need to zoom in/out, I think it is good enough for the scrolling ground and in this example it works ok for the boxes.

But for each draw_as_quad it will be called 2-4 times/frame and I wonder if this isn't exactly what I should be using OpenGL for, especially with the boxes (which display 3-4 tiles/box every frame).
Topic OpenGL vs fake 3D By rremedio Date 2015-11-20 15:50
So I've been playing with ideas for a side-scrolling adventure game (something between a run 'n gun, a beat 'em up and Flashback: The Quest for Identity).

One thing that I'd like to add is that "3d" effect when the ground scrolls, like some 16bit side-scrolling games (Mega Drive's The Adventures of Batman and Robin comes to mind), just because it is neat. After an hour remembering my old algebra and trigonometry lessons (buried deep in my mind after 20 years of using computers and calculators) it worked very well with tiles and the draw_as_quad method. Then I did the same for some basic 3d objects, like walls and boxes, just to see how hard and demanding it would be and it also worked nicely. But I wonder if I'm to include some basic 3d objects in my 2d games, should I forget about that and go straight OpenGL? I tried to make OpenGL work a few years ago and I gave up soon because of installation problems, but I'm sure it was something wrong I was doing.

It is not that I want a full 3d scenery but if I start to add too many objects and the game is supposed to have a few platforms, will I regret doing it in plain Gosu?

Thanks in advance! :D
Topic [Solved] Gosu and french By rremedio Date 2013-03-09 19:24
I don't use a real IDE, but I use SciTE: a text editor with some programming friendly features and sometimes I have the same problems, even if SciTE has an option for choosing the file encoding. But if I open the file in Notepad and Save As, selecting the correct encoding, the file now works perfectly in SciTE too. Have you tried this with Aptana?
Topic Weightlessness By rremedio Date 2013-03-07 22:09
Looks great! I'll try it.

edit: I tried it, very well done!
Topic gosu shapes color and design By rremedio Date 2013-02-24 15:41
I can't tell you about the best way to work with colors in that case cause I've never really used draw_shape methods. I think it will depend on the effects you want (take a look here But the way you coded worked here and yes, drawing methods (be them for shapes or sprites) should go into the main window draw method.
Topic gosu shapes color and design By rremedio Date 2013-02-24 13:41
I suppose you need values for x1, x2, etc...
Topic Out of focus By rremedio Date 2013-02-11 22:10
I think my poor English won't allow me to explain this properly.

You have very basic info here ->

And looks like there's an example on how to use the functions you need here -> - but he seems to be using another class than the default ruby Win32API class. I didn't look at the example code (you can download it).
Topic Out of focus By rremedio Date 2013-02-09 19:13
I'm almost sure it is possible by using the Win32API. Maybe this helps?

It's been a long time since I've studied such things.
Topic Gosu on iOS with mruby By rremedio Date 2012-10-28 23:52
Any chances to make Gosu work with Rhomobile or at least the part of it which compiles Ruby to bytecode? Apps work on several OS including iOS, Android and Win32.
Topic UTOPIA By rremedio Date 2012-07-01 23:37
Very beautiful. I've tried to create backgrounds on a similar style (in my case, inspired by the classic game Flashback: The Quest for Identity), but they don't look even close that good. I hope we can play your game soon =)
Topic mouse movement By rremedio Date 2012-06-28 04:46
For the mouse thing, I guess you could draw the cursor on the last position it had before leaving the game screen and make the scrolling according to its real position (so the farther the mouse position goes, the faster will be the scrolling). Keep in mind that you don't need to draw the cursor image on the real mouse_x/y positions, you may draw it where you want.

It's a way to do it, but it wouldn't keep the player from clicking outside the window (which would make the game window lose the focus).
Topic Online Multiplayer / Kaillera By rremedio Date 2012-06-18 19:53
I've made a test with the game Wrath under LAN and it worked nicely. Maybe I should use Chingu?
Topic Online Multiplayer / Kaillera By rremedio Date 2012-06-18 04:51
Thank you for the tip! I'm reading the gamespy docs and there are countless advantages. I have to check eventmachine better. I had problems trying to install it on windows in the past (it was required by the Thin server and I ended working with another server) but it seems to be working now.
Topic Online Multiplayer / Kaillera By rremedio Date 2012-06-18 04:06
I thouhgt I've already answer your reply. I guess I didn't push the Post button or did it at the wrong topic...I hope not :)

Yes, Kaillera is quite dead, I didn't notice until your reply. Getting players must be a bigger problem than anything else, but for now I would be happy by just forcing some friends of mine to test it.

I think getting Gosu working on NativeClient is way above my capabilities for now =/
Topic Online Multiplayer / Kaillera By rremedio Date 2012-06-14 07:38
Hi there!

I really don't have a project for this yet, but as I can't get my hands dirty with my shmup for a while, I was thinking of making a simpler game and all the ideas I have would be better with multiplayer support. I really don't know very much about this subject, but I've had some reading in the past and it seems to me there's need for solid understanding about it to create a multiplayer with acceptable performance. So I was thinking about using Kaillera, which is quite popular among emulators, looks easy to implement and I don't want to spend too much time on this as my main project doesn't need it (and I don't have too much free time as I think everyone doesn't =)

Kaillera, if you don't know, works with servers receiving the inputs from both players and sending them back, so the game/emulator performs the input received from the server, and not the direct input from the player (or it leaves the choice to the developer, I guess). There are plenty of public servers around the world and you can download the server application and run a server by yourself (which they do not recommend). Downsides are the client app not being cross platform (they say it will be in the future, for now it's a windows dll) and I think it's a bit restrictive about who you can play with (I have a 10Mb connection, which is good for brazilian standards, but I get high pings from most servers outside Brazil, higher than I get playing rFactor with servers from more distant places, but I think it wouldn't be a problem for now, as my Atari 2600-like game woudn't be played by too many people I too pessimist?).

I can't test week for a few weeks, so I decided to ask here what you do think. Does anyone know if Kaillera would be suitable for a Ruby Gosu game? Would it be worth learning who to make the multiplayer by myself and would it take too much time, assuming I don't have any knowledge about it? Is there any ready alternative?

Thanks you and sorry if I'm not very clear. I try my best, but english is not my thing yet.

Topic Starblind By rremedio Date 2012-06-08 15:49
That would be nice. I want to work on the music myself, but the game may need many soundtracks for me to make them all by myself =)

Thank you for the interest!!
Topic Starblind By rremedio Date 2012-05-24 16:17
Maybe too much: you linked this same thread =)
Topic Releasy over Ocra? By rremedio Date 2012-05-24 16:06
I'm not sure it was a problem with the error messages not being clear enough. I think it was my old code behaving oddly and my lack of best practices as I work with Ruby for very specific tasks and maybe tools like Releasy expect the users to make thing on a more "rubish" way (which I think is the way to go). And I still need to take some time to study Ruby and make my coding better.

Better error messages are always good, but after checking it again, I notice it builds even with missing files, so the real problem was a filename with a special character (and it was an image file not used by the app, it was generated by accident by pressing CTRL+V and I didn't notice). The message displayed talked about wrong encoding but I searched for it inside the source files until I noticed that useless image file. I really can't say if the message wasn't clear or I was a little dumb =)

Anyway, now everything works. Releasy is great! Thank you!
Topic Starblind By rremedio Date 2012-05-23 15:59
Thank you! For now I'm very confident on the performance. Anyway, thank you for the tips, I was using floats for the x/y positions and chipmunk initializing arrays, I can't say why, as that part of the code is old and I didn't comment it.

The game plays nicely with the gamepad. I didn't think about multiplayer, to be honest. It's not ver common with shmups, but I guess it might be fun, so I'll give it a chance.
Topic Releasy over Ocra? By rremedio Date 2012-05-23 15:32
Don't worry, Spooner. The problem was on my rakefile indeed (first, wrong "file" arguments, then a file named with invalid character on my resources). I'll still cannot build a win installer, but I'll check it again before asking for help (it seems like my installation is not recognizing innosetup and 7zip, but I'm not sure).

Thank you!
Topic Releasy over Ocra? By rremedio Date 2012-05-21 19:17
Maybe my installation is broken (I'm having a hard time installing several gems on my new Win7 64bits system, gem install releasy was not working, so I installed all dependencies manually), but I've tried to use Releasy just for testing and got the following error (trying rake build).

rake aborted!
No such file or directory - pkg/window_WIN32.exe

Tasks: TOP => build => build:windows => build:windows:folder => pkg/window_WIN32

(See full trace by running task with --trace)

Any ideas?

Topic Starblind By rremedio Date 2012-05-20 18:24
Hi there!

This a horizontal shmup I'm working on. In fact it started years ago when I've first heard about Gosu. But it was left becouse FPS performance was terrible and also becouse I've realized the amount of graphic work demanded. But for curiosity I've checked the code again some weeks ago and after updating it to latest Ruby/Gosu/Chipmunk versions, it runs pretty fast (I've made a test with around 200 objects on screen, many more than needed by this game, as it will not be a "bullet hell", but something more like older 16-bit games), so I decided to give it another try as now I have a talented friend willing to make the graphics.

All the graphics in the video were found on the internet (credits in the video description) and will be replaced in the game by original work. There is so much still to be done even for this small prototype (like explosions, stage start and finishing, better hud, etc...). In fact I've made the video just to show it for my partner so he has a grip on the action and decided to show it here too, that's why there are just four types of enemies. I'll upload the playable prototype as soon as it is finished.

I hope you like it, somehow, as it's not very polished yet.


Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill