I've been googling around and looking at the doc but I can't work out how to procedurally generate some background on a Gosu::Window such as for a platformer or suchlike. I would also want to bound the edges of the window so you can't go through the bottom and come out at the top, and be able to "move" left and right (I know the background would be moving, but you know what I mean).
Thanks in advance!
I suggest having some sort of Tile class, and your window generates them in some clever way. You just have to call each of their update and draw methods.
As for the physics, you could look at CptnRuby as an example.
"Some sort of clever way"? What ways could those be? Sorry, but I'm a complete newb to 2d games programming and Gosu, and only about a month or two going with Ruby.
Look at Texplay if you want to generate images at runtime.
To bound the player inside the window, just make sure the player's position does not exceed what is specified by the window size. I'll leave the specifics for you to figure out, partially because it depends on what sort of game you're making.
For constraining the scrolling, look at the CptnRuby example game.
A procedurally generated background is a bit more challenging. I actually forgot how I did it last time.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill